note 60777 modified in function.usort by danbrown
| From: | danbrown@php.net | Date: | Sun, 23 Jan 2011 16:27:37 +0000 |
| Subject: | note 60777 modified in function.usort by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-176071@lists.php.net to get a copy of this message | ||
Instead of doing :
<?php $strc = strcmp( strtolower($a[$f]), strtolower($b[$f]) ); ?>
you could do this :
<?php $strc = strcasecmp( $a[$f], $b[$f] ); ?>
which is more efficient and is does case insensitive comparison according to the current locale.
--was--
Instead of doing :
$strc = strcmp( strtolower($a[$f]), strtolower($b[$f]) );
you could do this :
$strc = strcasecmp( $a[$f], $b[$f] );
which is more efficient and is does case insensitive comparison according to the current locale.
http://php.net/manual/en/function.usort.php