Artenis Posted October 10, 2008 Report Share 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. Link to comment Share on other sites More sharing options...
andrisp Posted October 10, 2008 Report Share Posted October 10, 2008 Vispirms ielasi faila nosaukumus masīvā. Tad sort(). Tad foreach() cauri masīvam un dari savas lietiņas. Link to comment Share on other sites More sharing options...
Artenis Posted October 10, 2008 Author Report Share Posted October 10, 2008 opā... :) nu ok, mēģināšu! Link to comment Share on other sites More sharing options...
Grey_Wolf Posted October 10, 2008 Report Share 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 .... Link to comment Share on other sites More sharing options...
v3rb0 Posted October 10, 2008 Report Share Posted October 10, 2008 print_r(glob(*)); Link to comment Share on other sites More sharing options...
andrisp Posted October 10, 2008 Report Share Posted October 10, 2008 v3rb0, es nekur manuālī neredzu, ka būtu teikts, ka glob() atgriež alfabētiski. Link to comment Share on other sites More sharing options...
v3rb0 Posted October 10, 2008 Report Share 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()). Link to comment Share on other sites More sharing options...
bubu Posted October 10, 2008 Report Share 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) Link to comment Share on other sites More sharing options...
andrisp Posted October 10, 2008 Report Share Posted October 10, 2008 Ok, skaidrs. Link to comment Share on other sites More sharing options...
Recommended Posts