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