You are here: Re: Sorting an array « All PHP « IT news, forums, messages
Re: Sorting an array

Posted by Paul on 05/25/05 10:57

Hi Kate,

I don't think there is an "easy" way to do that.. I can be wrong though
it might that I just never had to do this. I would think a simple
solution (if applicable) would be to split your currency and ammounts in
the array.... so that it would look like this:
$tempArr['USD'] = 11;
or if you need it deeper in

$tempArr['product_name_or_code']['USD'] = 11;

the only reason I'm suggesting this way is because I know for sure there
are build in functions that will allow you to sort your array by it's
keys ... if you were to sort by last letter USD and CAD would conflict
anyways.... and maybe others :)

Hope that helps..

Paul

Kate wrote:
> I have an array with some product codes that I would like to sort by
> currency. The product codes look like these:
> 11USD, 11CAD, 11EUR, 119USD, 201EUR, 70CAD
>
> I figured that I could just sort it by the last character, but I can't find
> a sort function that does that (or maybe I just don't understand the sorting
> functions available).
>
>

 

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

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