note 38416 added to function.intval

From: Date: Fri, 19 Dec 2003 17:29:15 +0000
Subject: note 38416 added to function.intval
Groups: php.notes 
Request: Send a blank email to php-notes+get-62250@lists.php.net to get a copy of this message
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. ---- Manual Page -- http://www.php.net/manual/en/function.intval.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+38416 Delete -- http://master.php.net/manage/user-notes.php?action=delete+38416&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+38416&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#62250) next »