I'm trying to create an array that is containted in a Function and a while loop
The Function will create the array and the while loop will fill the array then it will be sorted then appended to a file.
I can't seem to figure out how to add to the array on the fly, I keep coming up with multiple arrays and each array contains a little more from the while loop.
while (false!=($file=readdir($dp)))
{
$sortedfiles[] = $tmp;
sort($sortedfiles);
print_r($sortedfiles);
}
thats just a snippet from the code, the rest is working i just cant seem to figure out what im missing on the array.
Heres the output I get
Array ([0] => IT-200-20.php)
Array ([0] => IT-000-00.php [1] => IT-200-20.php)
Array ([0] => IT-000-00.php [1] => IT-200-10.php [2] => IT-200-20.php)
Array ([0] => IT-000-00.php [1] => IT-200-10.php [2] => IT-200-20.php [3] => IT-400-10.php )
Array ([0] => IT-000-00.php [1] => IT-200-10.php [2] => IT-200-20.php [3] => IT-400-10.php [4] => IT-400-30.php )
The function is pulling a file list and it has to displayed really funky for what its used for and php doesnt sort it any partictular order so thats what im trying to fix
Any Help would be greatly appreciated Arrays seem to be kickin my butt today