simply:
$var1=99;
$var2=0;
$result=$var1*$var2; multiplication by zero is ok
if ($var2!=0) { //division by zero is bad  "!=" means not equal
$result=$var1/$var2; 
}
use brackets in complex equations 
$result=$var1*(1+$var2);

hugh

----- Original Message ----- 
From: "Adriaan Nel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 10, 2003 11:37 PM
Subject: [PHP] Maths on variables - please help


> Hi every1,
> 
> I would like some help on multiplication/division of variables on 1
> another....I have looked at the bcmath() function, but it doesn't seem to
> work.
> 
> Could any1 pls assist.
> 
> Adriaan
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to