Return to Snippet

Revision: 57008
at May 2, 2012 23:04 by akt


Initial Code
function array_field_sort(&$array, $field) {
	$code = "return strnatcmp(\$a['$field'], \$b['$field']);";
	$compare = create_function('$a,$b', $code);
	uasort($array,$compare);
}

Initial URL

                                

Initial Description
sort a multidimensional array by field

Initial Title
array sort field

Initial Tags
sort, array

Initial Language
PHP