Re: checkng if string is a number

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

 



  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!

-- 
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