note 6687 deleted from function.strcmp by irc-html
| From: | irc-html@php.net | Date: | Sun, 30 Dec 2001 08:02:01 +0000 |
| Subject: | note 6687 deleted from function.strcmp by irc-html | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-23977@lists.php.net to get a copy of this message | ||
I would love to see a function like strncmp() from C -- where you can specify the number of
characters to do a compare on. Also, I suppose, the case insensitive version for this would be good
too.<br>
<br>
My current workaround is somewhat silly.<br>
<br>
$Long = "This is a very long string";<br>
$Short = "This";<br>
if ($Short == substr($Long, 0, strlen($Short))) ... do something<br>
<br>
It just looks confusing.