title: Unable to get sort Array to work
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/6443493/php-sortarray-not-working-returning-1-instead-of-sorted-array">php sort($array) not working - returning 1 instead of sorted array</a>  </p>
  </blockquote>
  
  
  
  <p>I'm having a difficult time getting array sort() function to work as expected, I've also tried ksort() etc. ::: </p>
  
  <p><strong>This Works Fine</strong></p>
  
  <pre><code>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 =&gt; $count) {
     &lt;li&gt;&lt;span class="key"&gt;' . $value . '&lt;/span&gt; (' . $count . ')&lt;/li&gt;
  }
  </code></pre>
  
  <p><strong>End Result:</strong> 480000 (1), 80000 (2), 120400 (1)</p>
  
  <p>I now want to sort this so 80000 (2) is first in list folowed by 120400 (1) then 480000 (1)</p>
  
  <p>As soon as I add any <strong>sort()</strong> function like below I only get an output 1</p>
  
  <p>I'm not able to get this to work any help would bew appreciated</p>
  
  <pre><code>$return = array_count_values($vehicle_p); //Key Value Unique ( count )
  $return = sort($return);
  print_r($return);
  </code></pre>