PHP Salt


A little dash of PHP... my collection of php functions

Version: 2.34.4
Last Build: March 13, 2025 23:10pm (PST)

Main Menu

Home

Get PHP Salt


The Functions

array
db
file
graph
html
mail
math
misc
mobile
script
string
system
time
web
psDiv()
Simple safe divide.


Description:

For those of use who encounter a div/0, and we just want a 0 result



Usage:

$res = psDiv($n, $d);



Example:

	$res = psDiv(5, 0);
// $res will be 0




Code:

function psDiv($n, $d)
{
if ($d == 0) { return 0; }
return ($n / $d);
}

Changlelog:



See Also

And a shot out to:

PHP - php.net
Fedora Server - getfedora.com
Shameless ads to pay for site