note 96125 deleted from function.substr-compare by danbrown
| From: | danbrown@php.net | Date: | Wed, 10 Feb 2010 02:37:21 +0000 |
| Subject: | note 96125 deleted from function.substr-compare by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-165814@lists.php.net to get a copy of this message | ||
Note Submitter: guy.paddock AT gmail DOT com
----
This documentation isn't entirely accurate -- the default for $length doesn't appear to be
equal to the length of $main_str; it appears to be equal to the length of the longest string.
For example:
<?php
$a = "abc123";
$b = "abc";
echo "Is the documentation correct? ";
echo ((substr_compare($b, $a, 0) == (substr_compare($b, $a, 0, strlen($b)))) ?
'true' : 'false');
echo "\n";
?>