title: PHP usort by ascending array value
body: <p>Below is partial of my array</p>
  
  <p>I tried to use the function below to sort it to order by page ascending
  However it seems rumble around, the page are not in increment state.</p>
  
  <p>I not sure what's wrong with my sorting comparator function (cmp)</p>
  
  <pre><code>function cmp($a, $b) {
      return $a['page'] - $b['page'];
  }
  
  
  usort($chapter_result_array,"cmp");
  $chapter_result_array = array_reverse($chapter_result_array);
  
  
  
  [11] =&gt; Array
      (
          [link] =&gt; https://www.mywebsite.com/projects/funny-story/chapter-8-1.1046/
          [page] =&gt; 8.1
      )
  
  [12] =&gt; Array
      (
          [link] =&gt; https://www.mywebsite.com/projects/funny-story/chapter-8-2.1085/
          [page] =&gt; 8.2
      )
  
  [13] =&gt; Array
      (
          [link] =&gt; https://www.mywebsite.com/projects/funny-story/chapter-9-1.1114/
          [page] =&gt; 9.1
      )
  
  [14] =&gt; Array
      (
          [link] =&gt; https://www.mywebsite.com/projects/funny-story/chapter-6-1.890/
          [page] =&gt; 6.1
      )
  
  [15] =&gt; Array
      (
          [link] =&gt; https://www.mywebsite.com/projects/funny-story/chapter-6-2.995/
          [page] =&gt; 6.2
      )
  
  [16] =&gt; Array
      (
          [link] =&gt; https://www.mywebsite.com/projects/funny-story/chapter-7-1.1020/
          [page] =&gt; 7.1
      )
  
  [17] =&gt; Array
      (
          [link] =&gt; https://www.mywebsite.com/projects/funny-story/chapter-5-1.855/
          [page] =&gt; 5.1
      )
  </code></pre>