note 26745 deleted from function.intval by didou
| From: | didou@php.net | Date: | Sun, 18 May 2003 10:08:57 +0000 |
| Subject: | note 26745 deleted from function.intval by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-48491@lists.php.net to get a copy of this message | ||
Note Submitter: Rob_Kohr@no_need_to_email.me.com
----
intvar() will take a variable an chop off everything when it hits a non-int character
For example:
$var=intval("122a5");
//$var==122
example 2:
$var=intval("122.5");
//$var==122
This is nice if you want to turn a double into an int automatically rounding down
[editor note:
Functions ceil() and floor() should be used to turn floats into integers
Maxim]