note 28154 deleted from function.usort by jmcastagnetto
| From: | jmcastagnetto@php.net | Date: | Sat, 04 Jan 2003 07:15:32 +0000 |
| Subject: | note 28154 deleted from function.usort by jmcastagnetto | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-41650@lists.php.net to get a copy of this message | ||
Encountered a bug in 4.1.2 on Sun:
usort crashes (Apache error 500) when I am trying to sort a multi-dimensional array with same values
using this sort function:
function my_sort($a, $b)
{ return ($a[1] > $b[1]) ? -1 :1 ;
}
/*here, $a and $b single-dim arrays which are elements oof the multi-dim array being sorted by
usort. 1 is the string field that I am actually sorting by*/
Work around:
function by_name($a, $b)
{
return ($a[2] >= $b[2]) ? -1 :1 ;
}
:)
Hope this saves somebody time.