When I tried to divide something with zero ( 0 divided by 0), I got this error message in the browser. (Warning: Division by Zero)
I need the result from that division is 0 not that error message, what should I wrote in the code
You can not divide by 0 in any case of Math, thus you can not divide by 0 in php.
Anything divided by 0 is undefined.
If you want to get rid of the warning, check to make sure that you are not dividing by 0 before you divide.
Some things are just too simple 🙂
if ($iDivider == 0) { $iResult = 0; } else { $iResult = ($iNumber / $iDivider); };
cool its works ! thanks man