ユーザー定義のソート配列の問題
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><?PHP $number = array(array('tir','tire','100'), array('Oil','oil','50'), array('spk','spark','10')); function compare($x,$y){ if($x[1]==$y[1]){ return 0;} else if($x[1]<$y[1]){ return -1; } else{ return 1;} } usort($number,'compare'); print_r($number); ?>
$number = 配列( array('tir1','tire2','100'), array('Oil1','oil2','50'), array('spk1','spark2','10') ); 関数比較($x,$y){ if($x[1]==$y[1]){ 0を返します。 else if($x[1]