Mailinglisten-Archive |
Martin Ramsch wrote: > $t1=11; $t2=44; $t3=22; $t4=33; $t5=55; > $t6=10; $t7=13; $t8=66; $t9= 5; $t10=27; > $n = explode(' ', 't1 t2 t3 t4 t5 t6 t7 t8 t9 10'); > function xsort($a,$b) { > if ( $GLOBALS["$a"] == $GLOBALS["$b"] ) return 0; > return $GLOBALS["$a"] > $GLOBALS["$b"] ? 1 : -1; > } > usort($n, xsort); > echo "$n[9] $n[8]\n"; > Cool! Kristian -- Kristian Köhntopp, NetUSE Kommunikationstechnologie GmbH Siemenswall, D-24107 Kiel, Germany, +49 431 386 436 00 Using PHP3? See our web development library at http://phplib.netuse.de/ (We have moved! Update your bookmarks!)
php::bar PHP Wiki - Listenarchive