phpbar.de logo

Mailinglisten-Archive

[php] Re: Sortieren eines mehrdimensionalen Arrays

[php] Re: Sortieren eines mehrdimensionalen Arrays

Thomas Feyrer Dante_(at)_altmuehlnet.de
Sat, 11 Sep 1999 00:27:14 +0200


At 22:30 10.09.99 +0200, Martin Ramsch wrote:
>Thomas Feyrer schrieb am Freitag, den 10. September 1999:
>> $files = array(
>>    0 => array( "name" => "foo", "size" => "1 MByte" ),
>>    1 => array( "name" => "bar", "size" => "0.5 kByte" ),
>>    2 => array( "name" => "bla", "size" => "4.65 GByte" )
>> );
>> 
>> [...zu...]
>> 
>> $files = array(
>>    0 => array( "name" => "bar", "size" => "0.5 kByte" ),
>>    1 => array( "name" => "bla", "size" => "4.65 GByte" )
>>    2 => array( "name" => "foo", "size" => "1 MByte" ),
>> );
>
>function cmp($a,$b) {
>  return strcmp($a['name'], $b['name']) ;
>}
>usort($files, cmp);

Dadurch meint er nur:
Warning: Wrong datatype in usort() call in ???.php3 on line ??

Bye
 Dante



php::bar PHP Wiki   -   Listenarchive