[thelist] [PHP] variable conversion tip

Jay Blanchard jay.blanchard at niicommunications.com
Fri Nov 7 06:05:20 CST 2003


[snip]
> Having trouble getting PHP to treat string data (POST or GET) as a 
> number for a script calculation?

You can also use casts in PHP to achieve the same effect, like this:

$duration = (int)$HTTP_POST_VARS;
[/snip]

And then there is the always handy settype()

http://www.php.net/settype


More information about the thelist mailing list