FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


a problem with PHP





yutuski
I cannot convert string variables to integer variables, is there any function which I can use in php?
SystemWisdom
I believe you are looking for the 'intval()' function in PHP...

Simply pass the string to intval() and it will return your integer...

You can get reference on the fuction here

I hope that helps!
Antoine_935
did you try settype() ?
kv
or you can just type cast it.

ex:

$intvar=(int)$strvar;

easy!
charliehk
If you use settype, you could set the type to integer by

settype($text, "integer");
charliehk
just post your question here

I think someone will be able to answer!
Related topics
problem with a php randomizer script
A PHP problem !
HTML + PHP problem
A php problem
PHP problem...
PHP include code problem
PHP Problem: Unable to execute ext. commands
PHP homepage recreation problem
PHP Problem...
Problem with PHP
PHP script problem
[suggestion] about the language translation forum
PHP Form Sending problem
Stats problem - php execution problem (MOD Assist Required)
How to accept data with super and subscript
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.