You are here: Re: Sorting a Two Dimensional Array « PHP Programming Language « IT news, forums, messages
Re: Sorting a Two Dimensional Array

Posted by Janwillem Borleffs on 06/26/06 21:12

StevePBurgess@gmail.com wrote:
> I just can't seem to get it to work. I'm sorry - I realise that this
> is probably really easy but my brain isn't working today and the
> examples on php.net seem incomprehensible to me.
>

// $key = 'Freq';
$key = 'Name';

function callback($a, $b) {
global $key;
if ($a[$key] == $b[$key]) return 0;
return $a[$key] > $b[$key] ? 1 : -1;
}
uasort($array, 'callback');


JW

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация