[SOLVED]Warning: Division by zero
Posted: Sun Jan 14, 2007 3:28 pm
It's been a while sense I've been on php code forum. Been working on client stuff.
I get a php error:
line 284 to 286:
I don't understand why the php parser is saying that ($newwidth/$imgheight) is division by 0??? It's clearly not zero at all.
According to my arithmetics it would work perfect. Unless I'm going wrong somewhere.
I get a php error:
line 286:Warning: Division by zero in "the url" on line 286
Code: Select all
$newwidth = ($newwidth/$imgheight);
Code: Select all
list($imgwidth, $imghieght) = getimagesize("Url");
$newwidth = (($imgwidth * 100));
$newwidth = ($newwidth/$imgheight);
According to my arithmetics it would work perfect. Unless I'm going wrong somewhere.