Sorting Arrays
| From: | Mark @ Webbiz NZ | Date: | Tue, 28 Jan 2003 05:10:18 +0000 |
| Subject: | Sorting Arrays | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-25190@lists.php.net to get a copy of this message | ||
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