Mark Not exactly sure what you're after but will array_multisort() help? http://www.php.net/array_multisort Rich -----Original Message----- From: Mark @ Webbiz NZ [mailto:mark@webbiznz.net.nz] Sent: 28 January 2003 05:10 To: php-db@lists.php.net Subject: Sorting Arrays Hello, I don't understand arrays that well. If someone can help me sort the contents it would be appreciated. I have data being retrieved from a text file and the fields as an array inserted into another array. orderby is numeric is 1-99 and requires sorting ASC content is just formatted html for instance : While Loop $a++ Get Data content & orderby $marray[$a] = Array("content"=>$msort , "orderby"=>$orderby[1]); End After this data is retrieved I would like to sort the information by the orderby field. Then the information is printed from the content field as per the sorted order foreach ($marray as $val) { echo $val['content']; } If someone can help me out, this would be appreciated. Regards Mark NZ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php