Dopo 2 giorni bloccato su questo problema, ho risolto così:
[php]
class esempio{
/++++++++++++++++++++++++++++++++++++++++++++
PER PHP 5.2
+++++++++++++++++++++++++++++++++++++++++++++/
/+++++++ Variabili per ordinare l'array +++++/
var $name_ord; //Nome dell'indice
var $rule_ord; //regola
/*++++++ Dispone gli elementi dell'attay +++++++*/
function xsort($a,$b){
switch ($this->rule_ord) {
case "ASC":
if($a[$this->name_ord]==$b[$this->name_ord]) return 0;
if($a[$this->name_ord]<$b[$this->name_ord]) return -1; else return +1;
break;
case "DESC":
if($a[$this->name_ord]==$b[$this->name_ord]) return 0;
if($a[$this->name_ord]<$b[$this->name_ord]) return +1; else return -1;
break;
}
}
/* Ordina array bidimensionale ... riceve l'array, il nome del campo da considerare,
e l'ordine crescente o decrescente restituendo l'array ordinato. */
function ordina_bi($array,$name,$rule){
$this->name_ord=$name; //imposta regola e indice che servirà a xsort ...Maledetto php 5.2
$this->rule_ord=$rule;
usort($array, array(&$this, "xsort"));
return $array;
}
}//end class[/php]
Purtroppo attualmente non ho possibilità di testare sul server dove verrà eseguito il codice... spero proprio che funzioni.
Ciao