title: Sort multidimensional array
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/96759/how-do-i-sort-a-multidimensional-array-in-php">How do I sort a multidimensional array in php</a>  </p>
  </blockquote>
  
  
  
  <p>I have multidimensional array, for exaple this:</p>
  
  <p><strong>$mas = array("s",array("c","b","a"),array(3,5,1),"a",array("s",array("z","a")));</strong></p>
  
  <p>I want sort (ascending) all array-elements, i write recursive function, but it is not working, please tell me, who I have a wrong ?</p>
  
  <pre><code>$mas = array("s",array("c","b","a"),array(3,5,1),"a",array("s",array("z","a")));
  
  
  
  function sortsort($m) {
      sort($m);
      foreach ($m as &amp;$v) {
          if (is_array($v)) {
               sortsort($v);
          }
      }
      return $m;
  }
  
  
  
    var_dump(sortsort($mas));
  </code></pre>