phpbar.de logo

Mailinglisten-Archive

[php] Re: aus Variablenpool die 2 mit den =?iso-8859-1?Q?h=F6chsten?= Werten heraussu chen? chen?u chen? chen?

[php] Re: aus Variablenpool die 2 mit den =?iso-8859-1?Q?h=F6chsten?= Werten heraussu chen? chen?u chen? chen?

Kristian =?iso-8859-1?Q?K=F6hntopp?= kk_(at)_netuse.de
Wed, 06 Oct 1999 10:47:54 +0200


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