note 14740 added to function.array-multisort.php
| From: | sputnikdog at yahoo dot com | Date: | Mon, 13 Aug 2001 06:18:28 +0000 |
| Subject: | note 14740 added to function.array-multisort.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-16631@lists.php.net to get a copy of this message | ||
I have a problem here:
I have 2 arrays, one to store the number of hits, and another to store the pagenames associated
with it. These arrays are dynamically created by my script:
here's the pseudocode
loop..
$hit[] equals page hits
end loop..
loop..
$pagenames[] equals page names
end loop..
How can I do something like array_multisort($pagenames,$hits) ?
If I do a
for($i=0; $i<count($link); $i++){
echo "$hit[$i]";
echo "$pagenames[$i]";
}
I don't get the result sorted according to the page hits.
How do I that?
http://www.php.net/manual/en/function.array-multisort.php