note 21943 added to function.str-replace
| From: | eden | Date: | Fri, 31 May 2002 17:40:07 +0000 |
| Subject: | note 21943 added to function.str-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-31301@lists.php.net to get a copy of this message | ||
Please, note:
<?
$string="135.728.189-57";
$string2=(str_replace(".","",$string)) &&
(str_replace("-","",$string));
if ( ($string2=="") || (!is_numeric($string2)) )
{
echo "<font color=\"red\">Not a number !</font>";
}
else
{
echo $string;
}
?>
Well, in this test, it returns the first option of the case if (Not a number) ! I just can`t get it
! If I write:
<?
echo $string2;
?>
It gotta return "1" !!!!!!!!!!!!!
Is this a bug ????
--
http://www.php.net/manual/en/function.str-replace.php
http://master.php.net/manage/user-notes.php?action=edit+21943
http://master.php.net/manage/user-notes.php?action=delete+21943
http://master.php.net/manage/user-notes.php?action=reject+21943