Pass key of object via arguments
<p>I have this code:</p>

<pre><code>function cmp_asc($a, $b){
    $ta = date_create_from_format('Y/m/d', $a['props']['t']); //  Y/n/j  si no tienen 0 inicial
    $tb = date_create_from_format('Y/m/d', $b['props']['t']);
    $interval = date_diff($ta, $tb);

    if($interval-&gt;days != 0){
        if($interval-&gt;invert == 1){
            return 1;
        }else{
            return -1;
        }
    }else{
        return 0;
    }
}

$arr1 = array(
    'props' =&gt; array('t' =&gt; '2012/05/20')
);

$arr2 = array(
    'props' =&gt; array('t' =&gt; '2012/05/21')
);

$arr3 = array(
    'props' =&gt; array('t' =&gt; '2012/04/14')
);

$arr = array($arr1, $arr2, $arr3);

uasort($arr, 'cmp_asc');
</code></pre>

<p>and I'd like to know if I can pass the <code>['props']['t']</code> via arguments. 
So, it will end up like: </p>

<pre><code>function cmp_asc($a, $b, $key){
    $ta = date_create_from_format('Y/m/d', $a &lt;-- $key --&gt;);
    ...
...
</code></pre>

<p>I'm thinking about variable variables, but I'm not too sure this is the right way to do it. 
Any other ideas?</p>
