# Actionscript and php question

**URL:** <https://forum.kirupa.com/t/actionscript-and-php-question/137570>\
**Category:** Uncategorized\
**Created:** [February 15, 2005, 8:18pm UTC](https://forum.kirupa.com/t/actionscript-and-php-question/137570 "2005-02-15T20:18:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![veraxoxo](https://avatars.discourse-cdn.com/v4/letter/v/f19dbf/32.png) [@veraxoxo](https://forum.kirupa.com/u/veraxoxo)\
**Post date:** [February 15, 2005, 8:18pm UTC](https://forum.kirupa.com/t/actionscript-and-php-question/137570/1 "2005-02-15T20:18:51Z")

</div>

My actionscript file is reading an image folder via a php script. Does anyone know which order the script reads the files in. Currently it doesn’t necessarily read them in alphabetical order, nor in date order. In fact, I can’t see any logical order when I print out the files it has read.  
Here’s the script (any insight would be graetly welcomed):

\<?php

$filepath = “thumbs”;

$handle = opendir($filepath);  
while (false != ($file = readdir($handle))) {  
if ($file != “.” && $file != “…” && $file != “.DS\_Store” && $file != “index.html” && $file != “index.htm” && $file != “index.php”) {  
if ($output) $output .= “|”;  
$output .= “$file”;  
}  
}

closedir($handle);  
echo “&files=$output&”;

?\>
