note 17968 added to function.strncmp

From: Date: Sat, 05 Jan 2002 13:42:07 +0000
Subject: note 17968 added to function.strncmp
Groups: php.notes 
Request: Send a blank email to php-notes+get-24426@lists.php.net to get a copy of this message
when testing the code: $str1 = "sample"; $str2 ="sam"; $result = strncmp($str1, $str2, 4); the $result is 1 instead of 0. If its like it says in the description "If any of the strings is shorter than len, then the length of that string will be used for the comparison", shouldn't $result here be 0? -- http://www.php.net/manual/en/function.strncmp.php http://master.php.net/manage/user-notes.php?action=edit+17968 http://master.php.net/manage/user-notes.php?action=delete+17968 http://master.php.net/manage/user-notes.php?action=reject+17968

« previous php.notes (#24426) next »