Artenis Posted October 10, 2008 Report Posted October 10, 2008 $a='0'; $folder=dir("galerijas/".$row['mape']."/"); while($folderEntry[$a]=$folder->read()){ if ($folderEntry[$a]!='.' && $folderEntry[$a]!='..'&& $folderEntry[$a]!='Thumbs.db'&& $folderEntry[$a]!='thumb'){ echo $folderEntry[$a].'<br>'; $a++; } } Ko te pielikt, ko atņemt, lai nolasītu foldera saturu alfabēiskā secībā!? Iepriekš paldies.
andrisp Posted October 10, 2008 Report Posted October 10, 2008 Vispirms ielasi faila nosaukumus masīvā. Tad sort(). Tad foreach() cauri masīvam un dari savas lietiņas.
Grey_Wolf Posted October 10, 2008 Report Posted October 10, 2008 Ko te pielikt, ko atņemt, lai nolasītu foldera saturu alfabēiskā secībā!? Neko pielikt neko atnjemt ... Faili lasaas to ievietosanas seciiba (un vieniigi ) , talak jau ir programmiska kartosana ....
andrisp Posted October 10, 2008 Report Posted October 10, 2008 v3rb0, es nekur manuālī neredzu, ka būtu teikts, ka glob() atgriež alfabētiski.
v3rb0 Posted October 10, 2008 Report Posted October 10, 2008 according to the rules used by the libc glob() function % man glob ...The argument flags .. GLOB_NOSORT By default, the pathnames are sorted in ascending ASCII order; this flag prevents that sorting (speeding up glob()).
bubu Posted October 10, 2008 Report Posted October 10, 2008 v3rb0, es nekur manuālī neredzu, ka būtu teikts, ka glob() atgriež alfabētiski. imho tas ir teikts šite: GLOB_NOSORT - Return files as they appear in the directory (no sorting)
Recommended Posts