Re: Converting to integer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Octavian Rasnita <orasnita@xxxxxx>:
> I get some values from a MySQL table and some of them are in the format
> 1000.0, 234.0, etc.
>
> I want those values converted as 1000, 234, and so on, but the other string
> values need to remain the same.
>
> I have tried using the function is_numeric to test which of the values
> returned from MySQL are numbers, but none of them appear to be a number, so
> I cannot convert them.

Use intval($value) to get the integer value.

-- 
Matthew Weier O'Phinney           | mailto:matthew@xxxxxxxxxx
Webmaster and IT Specialist       | http://www.garden.org
National Gardening Association    | http://www.kidsgardening.com
802-863-5251 x156                 | http://nationalgardenmonth.org

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux