title: Sorting array value in descending order
body: <p>How can I sort the values in descending order? I've tried arsort(); but it doesn't work in my case:</p>
  
  <pre><code>$text1 = 'Android SDK, application, familiar with MVP architecture, android studio, angular, angular js';
  
  $skill = array("android sdk"=&gt;"3", "application"=&gt;"1", "angular"=&gt;"2", "android studio"=&gt;"3", "angular js"=&gt;"3");
  
  foreach ($skill as $skills =&gt; $weight)            {
  
  if (preg_match_all("~\b$skills\b~i", $text1, $matchWords)) {  
  
  $matchWords = $matchWords[0];
  
  $matchWords = array_unique($matchWords);
  
  }  
  
  $text2 = 'Native Android development';
  
  // Filter $words, keep only the items that are not present in $text2
  $missing = array_filter(
      $matchWords,
      function($w) use ($text2) {
          // return TRUE when $w is not in $text
          return preg_match('/\b'.preg_quote($w, '/').'\b/i', $text2) == 0;
  });
  
  
  $weight = array($weight);
  $dev = array_combine($missing, $weight);
  arsort($dev);
  
  foreach($dev as $x =&gt; $x_value) 
       echo "Key: " . $x . " Value: " . $x_value;
       echo "&lt;br&gt;";
  
  }
  </code></pre>
  
  <p>Output:</p>
  
  <p>Key: Android SDK Value: 3
  Key: application Value: 1
  Key: angular Value: 2
  Key: android studio Value: 3
  Key: angular js Value: 3</p>
  
  <p>But I'd like to get this result:</p>
  
  <p>Key: Android SDK Value: 3
  Key: android studio Value: 3
  Key: angular js Value: 3
  Key: angular Value: 2
  Key: application Value: 1</p>
  
  <p>EDIT:</p>
  
  <p>I haven't found an answer <a href="https://stackoverflow.com/questions/51541082/how-to-arsort-the-following-array">here</a> as suggested.</p>