[thelist] PHP 2D array sort

PhilParker.DNS PhilParker.DNS at btinternet.com
Tue May 21 08:14:00 CDT 2002


I am trying to sort a 2 dimensional array in PHP.

$a = array(array (
			"text" => "",
			"qty" => 0
			));
$a['text'][0] = "two";
$a['qty'][0] = 2;

$a['text'][1] = "one";
$a['qty'][1] = 1;

I want to order $a['text'] by $a['qty'], but the sort functions don't
appear to have facility for this. Do I have to build my own bubble sort?

TIA
Phil




More information about the thelist mailing list