Re: intval
| From: | kranthi | Date: | Sat, 09 May 2009 15:53:27 +0000 |
| Subject: | Re: intval | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-292421@lists.php.net to get a copy of this message | ||
k i ended up with this code....
<?php
$_POST = array( '1', '100', '100.1', '100.123',
'a');
foreach( $_POST as &$value )
{
if(is_numeric($value)) {
$value = $value + 0;
}
}
var_dump($_POST);
?>
its giving me
array(5) { [0]=> int(1) [1]=> int(100) [2]=> float(100.1) [3]=>
float(100.123) [4]=> &string(1) "a" }
what does &string mean ??