Multi-Dimensional Array Sorts for PHP
To sort a multi-dimensional array in PHP, you can use usort, like so:
usort($aArray,"cmp_func");
function cmp_func($a,$b)
{
return strcasecmp($a['x'],$b['x']);
}
Print article | This entry was posted by elvis on 04/02/09 at 07:57:23 pm . Follow any responses to this post through RSS 2.0. |