Re: checkng if string is a number
| From: | Max Belushkin | Date: | Thu, 17 Nov 2005 19:47:30 +0000 |
| Subject: | Re: checkng if string is a number | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-226004@lists.php.net to get a copy of this message | ||
Which version of PHP are you using? On php 4.4.0 (SuSE 10.0 default RPM, not
custom build, so perhaps I'm missing some extras you're using?) the following
script works fine:
<?php
if (10==intval("ten")) echo "boo\n"; else echo "no boo\n";
?>
I get no boo. intval doesn't convert my "ten" to a number. Moreover, the
output of the following:
<?php
echo intval("ten");
?>
produces an expected (by me) 0.
On Thursday 17 November 2005 20:37, blackwater dev wrote:
> do something else. is_int doesn't work, intval converts "ten" to a
> number so that doesn't work....
>
> Thanks!