You are here: Ordering array won't work? « PHP Programming Language « IT news, forums, messages
Ordering array won't work?

Posted by frizzle on 10/25/06 18:06

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 ?

Thanks, Frizzle.

$dir = opendir("./img/");

while( $file = readdir($dir)){
if (preg_match("/\.gif$/", $file)) {

$filename = preg_replace( "/\.gif$/", '', $file );
$_SESSION['all_pics'][$filename] = "Foobar";

};
};

closedir( $dir );

asort( $_SESSION['all_pics'] );

 

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

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