You are here: Re: Multidimensional Array Question « All PHP « IT news, forums, messages
Re: Multidimensional Array Question

Posted by MS on 09/22/06 00:17

"moosus" <junk{@}fishingmonthly.com.au> wrote in message
news:C1394795.8A00%junk{@}fishingmonthly.com.au...
> MS
>
> My problem is that I am on Ver3.23.37 of MySQL which like VIEWS doesn't
> support UNION's
>

Sorry about that... must have missed the part where you mentioned the Ver.

Just to clarify... in Ver3.23.37 of MySQL do they have the SELECT
Statement??? just kidding.. i presume they do...lol
Try this to sort your Array

<?php
//The "name" literal is the name of the key you want to sort on

if(is_array($Myarray)){
usort($Myarray, "ArraySortOnKey");
}

// Myarray is now sorted on the "name" Key.

// Sorts multi-dimensional array on Name
function ArraySortOnKey($a, $b) {
return strnatcasecmp($a["name"], $b["name"]);
}
?>

Best Wishes
MS

----------------------------------------------------------------------------
Join MyClubWeb.co.uk - The Home of Club Websites and Medium to Small
Businesses.
----------------------------------------------------------------------------

 

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

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