problem in sorting 2-d array sort
<p>I m facing problem in sorting this 2-d array on the basis of key eg(33 in the sample code)
so the output will look like 7,7,28,33,35,38.Here is the sample code.</p>

<p>thanks in advance</p>

<pre><code>&lt;?php
$arr=array ( 0 =&gt; array ( 33 =&gt; 'SY2', ), 1 =&gt; array ( 38 =&gt; 'PR25', ), 2 =&gt; array ( 7 =&gt; 'SK22', ), 3 =&gt; array ( 7 =&gt; 'BT1', ), 4 =&gt; array ( 28 =&gt; 'WN8', ), 5 =&gt; array ( 35 =&gt; 'ST21', ));
print_r($arr);
$arrnew=array();
$str=0;
for($j=0;$j&lt;count($arr);$j++){
 foreach($arr[$j] as $key=&gt;$val){
  if($str == 0)
   $str=$arrnew[$key];
  if($str &lt; $arrnew[$key])

  //$arrnew[$key]=$val;
  //echo $key."&lt;BR&gt;";
 }
}

print_r($arrnew);
</code></pre>
