Reply to Re: Ordering array won't work?

Your name:

Reply:


Posted by Rik on 10/25/06 18:22

frizzle wrote:
> Hi there,
>
> I want to scan a dir, put the *.gif into an array, and order that (
> 01.gif, 02.gif etc),
> and put that array into a $_session-array. (Session & Headers are
> initiated before this code)
> I have the code below, everything works, except for the ordering.
>
> Any clues ?

> $_SESSION['all_pics'][$filename] = "Foobar";

> asort( $_SESSION['all_pics'] );

Well, if the value of every array item is the same, offcourse there will be
no sorting done.
If you want to sort on key:
ksort($_SESSION['all_pics']);

Allthough I can't image why:
$_SESSION['all_pics'][] = $filename;
...
asort($_SESSION['all_pics']);
does not do...
--
Rik Wasmus

[Back to original 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

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