Possible Duplicate:
php sort($array) not working - returning 1 instead of sorted array
I'm having a difficult time getting array sort() function to work as expected, I've also tried ksort() etc. :::
This Works Fine
foreach( (array) $query as $post ) {
$VP = ( ( empty($PMD['vehicle_price'][0]) ) ? $VP = 'On Request' : $VP = $PMD['vehicle_price'][0] );
$vehicle_p[] = $VP;
}
$return = array_count_values($vehicle_p); //Key Value Unique ( count )
foreach($return as $value => $count) {
<li><span class="key">' . $value . '</span> (' . $count . ')</li>
}
End Result: 480000 (1), 80000 (2), 120400 (1)
I now want to sort this so 80000 (2) is first in list folowed by 120400 (1) then 480000 (1)
As soon as I add any sort() function like below I only get an output 1
I'm not able to get this to work any help would bew appreciated
$return = array_count_values($vehicle_p); //Key Value Unique ( count )
$return = sort($return);
print_r($return);