PHP Sort Multidimensional array by value which has NULL using uasort
<p>i have created an arry like</p>

<pre><code>$arr[0]['ref']=5;
$arr[0]['name']='name0';

$arr[1]['ref']=6;
$arr[1]['name']='name1';

$arr[2]['ref']=4;
$arr[2]['name']='name2';

$arr[3]['ref']='';
$arr[3]['name']='name3';

$arr[4]['ref']='9';
$arr[4]['name']='name4';

$arr[5]['ref']=''
$arr[5]['name']='name5'
</code></pre>

<p>I want to sort this array like using ref value</p>

<pre><code>$arr[2]['ref']=4;
$arr[2]['name']='name2';

$arr[0]['ref']=5;
$arr[0]['name']='name0';

$arr[1]['ref']=6;
$arr[1]['name']='name1';

$arr[4]['ref']='9';
$arr[4]['name']='name4';

$arr[3]['ref']='';
$arr[3]['name']='name3';

$arr[5]['ref']=''
$arr[5]['name']='name5'
</code></pre>

<p>i tried </p>

<pre><code>uasort($arr, function($a, $b){
    return $a['ref'] - $b['ref'];
});
</code></pre>

<p>But '' values are coming at the beginning. How can I push '' down. </p>

<p>Thanks in advance. I am beginner. please excuse me if i am asking very simple question</p>