Re: array sort

From: Date: Tue, 22 May 2001 18:19:04 +0000
Subject: Re: array sort
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-53891@lists.php.net to get a copy of this message
> on a whim, I tried > uasort($this->modules[$group], '$this->_ary_sort()'); hi all, for those of you interested: uasort($this->modules[$group], array(&$this,'_ary_sort')); note the &$this... this is a very good point, if you use $this, a new instance of your class is created just to handle to sort :) elsewhere in the same class: function _ary_sort($a,$b) { return $a['init'] - $b['init']; } is my 'final' code (thanks markus). _alex

« previous php.general (#53891) next »