Sort Array in PHP

Posted by DonCroce on Stack Overflow See other posts from Stack Overflow or by DonCroce
Published on 2011-03-04T23:24:18Z Indexed on 2011/03/04 23:24 UTC
Read the original article Hit count: 123

Filed under:

I have a script which gets some values from a DB.

The structure of the vars is as the following:

$dump["likes"] = 1234; $likes["data"][$i]["name"] = "ABCDEFG";

for($i=0;$i<=$max;$i++){



$data[$i]["likes"] = $dump["likes"];
$data[$i]["name"] = $likes["data"][$i]["name"];

}

//Print Here Sorted array (highest value in "like" first)

I just need a way to find out in which entry the biggest "likes" are :)

So far i have tried array_multisort, but it showed me "inconsistent size" or some error...

Thanks for all your help!

© Stack Overflow or respective owner

Related posts about php