$z = intval($x / $y);

Op donderdag 21 februari 2002 02:06, schreef James Taylor:
> Just curious what the function is to convert x into an integer if it's a
> float.... Say for example I have something like this
>
>
> $x = 7;
> $y = 3;
>
> $z = $x / $y;
>
> I want $z to equal 2.  In perl it would be
>
> $z = int($x / $y);
>
> I'm just not sure how to do this in PHP, as int apparently doesn't work
> (darn).  I'm using 4.06 by the way, so if there's some new function in 4.1
> that does this, I can't use it... so < 4.1 functions please

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

Reply via email to