note 38416 deleted from function.intval by nlopess

From: Date: Fri, 19 Dec 2003 17:58:03 +0000
Subject: note 38416 deleted from function.intval by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-62251@lists.php.net to get a copy of this message
Note Submitter: thedao@bol.com.br ---- Say you have this: $h1 = '123456i89'; // $h1==123456i89 $h2 = intval($h1); // $h2==123456 Comparing: if( $h1==$h2 ) echo $h1.' == '.$h2; else echo $h1.' != '.$h2; // Prints 123456i89 == 123456 But: if( strval($h1) == strval($h2) ) echo $h1.' == '.$h2; else echo $h1.' != '.$h2; // Prints 123456i89 != 123456 // Which seems much more reasonable to me.

« previous php.notes (#62251) next »