title: How to do hierarchical sorting in PHP array?
body: <p>I want to sort a table with hierarchical keys but I can not :( Here's an example:</p>
  
  <pre><code>array ( '1.1.1' =&gt; 'test1', '10.1.1' =&gt; 'test2', '2.1.1' =&gt; 'test3', 1 =&gt; 'test4', 2 =&gt; 'test5', 3 =&gt; 'test6', '0.1' =&gt; 'test7', 0 =&gt; 'test8', 10 =&gt; 'test9', )
  </code></pre>
  
  <p>The result must to be :</p>
  
  <pre><code>array ( '0' =&gt; 'test8', '0.1' =&gt; 'test7', '1' =&gt; 'test4', '1.1.1' =&gt; 'test1', '2' =&gt; 'test5', '2.1.1' =&gt; 'test3', '3' =&gt; 'test6',  '10' =&gt; 'test9', '10.1.1' =&gt; 'test2')
  </code></pre>
  
  <p>Thank a lot !</p>
  
  <p>My attempt : 
  <a href="https://notepad.pw/71vyf2f7" rel="nofollow noreferrer">https://notepad.pw/71vyf2f7</a></p>