note 46128 deleted from function.strcmp by vrana
| From: | vrana@php.net | Date: | Tue, 12 Oct 2004 08:10:29 +0000 |
| Subject: | note 46128 deleted from function.strcmp by vrana | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-78388@lists.php.net to get a copy of this message | ||
Note Submitter: chabs_guru at yahoo dot com
----
I find that spaces are ignored while making the string comparision. That is, strcmp("abc
", "abc") returns 0. If you want to avoid that, you can use something like the
following:
<?php
function strcmp_s($s1, $s2)
{
return strcmp("a".$s1."a", "a".$s2."a");
}
?>