note 17968 deleted from function.strncmp by dave

From: Date: Sun, 08 Aug 2004 02:15:10 +0000
Subject: note 17968 deleted from function.strncmp by dave
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-74186@lists.php.net to get a copy of this message
Note Submitter: adrie01@hotmail.com ---- 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?

« previous php.notes (#74186) next »