note 19166 added to function.strncmp

From: Date: Mon, 18 Feb 2002 16:45:26 +0000
Subject: note 19166 added to function.strncmp
Groups: php.notes 
Request: Send a blank email to php-notes+get-26748@lists.php.net to get a copy of this message
$str1 = "sample"; $str2 ="sam"; echo strncmp($str1, $str2, 2); ->0 echo strncmp($str1, $str2, 3); ->0 echo strncmp($str1, $str2, 4); ->1 echo strncmp($str1, $str2, 5); ->2 why? if the definition is correct, the 2 strings are equal in the long of the sort string, 3 chars. why? -- http://www.php.net/manual/en/function.strncmp.php http://master.php.net/manage/user-notes.php?action=edit+19166 http://master.php.net/manage/user-notes.php?action=delete+19166 http://master.php.net/manage/user-notes.php?action=reject+19166

« previous php.notes (#26748) next »