title: Code Comparison for Same Result Between ksor PHP and sort VB.Net
body: <p>I need to sort array on <code>VB.Net</code> that equivalent of <code>ksort</code> on <code>PHP</code>.
  I try to compare both of them but the result is different.
  Here is my <strong>PHP Code</strong>:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  $parameter['data[1000].isi']= '0';
  $parameter['data[111].isi']= '0';
  $parameter['data[112].isi']= '0';
  $parameter['data[100].isi']= '0';
  $parameter['data[3].isi']= '0';
  $parameter['data[2].isi']= '0';
  $parameter['data[1].isi']= '0';
  $parameter['data[0].isi']= '0';
  
  ksort($parameter);
  
  foreach($parameter as $key =&gt; $val){
      echo $key." = ".$val."&lt;br /&gt;";
  }
  ?&gt;
  </code></pre>
  
  <p>The <strong>output</strong> goes:</p>
  
  <pre><code>data[0].itemNo = 0
  data[1000].isi = 0
  data[100].isi = 0
  data[111].isi = 0
  data[112].isi = 0
  data[1].isi = 0
  data[2].isi = 0
  data[3].isi = 0
  </code></pre>
  
  <p>And here is my <strong>VB.NET Code</strong>:</p>
  
  <pre class="lang-vb prettyprint-override"><code>        Dim isi As New Dictionary(Of String, String)
          isi.Add("data[1000].isi", 0)
          isi.Add("data[111].isi", 0)
          isi.Add("data[112].isi", 0)
          isi.Add("data[100].isi", 0)
          isi.Add("data[3].isi", 0)
          isi.Add("data[2].isi", 0)
          isi.Add("data[1].isi", 0)
          isi.Add("data[0].isi", 0)
  
          Dim coba As New ArrayList()
          Dim str, strisi As String
          For Each kvp As KeyValuePair(Of String, String) In isi
              coba.Add(kvp.Key &amp; "=" &amp; kvp.Value)
          Next
          coba.Sort()
  
          For Each apa As String In coba
              str = str &amp; "&amp;" &amp; apa
          Next
          TextBox1.Text = str
  
  </code></pre>
  
  <p>The <strong>output</strong> goes:</p>
  
  <pre><code>&amp;data[0].isi=0
  &amp;data[1].isi=0
  &amp;data[100].isi=0
  &amp;data[1000].isi=0
  &amp;data[111].isi=0
  &amp;data[1111].isi=0
  &amp;data[112].isi=0
  &amp;data[2].isi=0
  &amp;data[3].isi=0
  </code></pre>
  
  <p>Output of both sorting is different. I need to make <code>VB.Net</code> Output same with <code>PHP</code> output.
  Hot to do that?</p>