Hi!
Im trying to set up a text-based way to update my website, getcoded.net. My web host still has not upgraded their servers to deal with MySql, my preferred method 🙁.
My problem is that when it searches in the directory for certain files( ie: $username$date.bcu ) and displays them with the code below,
<?php
$handle=opendir('.');
while (false!==($file = readdir($handle))) {
if ($file != "." && $file != ".." && ereg(".bcu", $file) {
$user_date = explode("", $file);
$date = explode(".", $user_date[1]);
$rdate = $date[0];
$username = $user_date[0];
$fp = fopen( $file, "r" );
$info = fread( $fp, filesize( $file ) );
fclose( $fp );
$info = explode( "|", $info);
//Format it...
}
}
closedir($handle);
?>
it doesn't come up in any particluar order. How can I get it to order it correctly and still preserve all the formatting? I've tried loading the contents of the directory into an array, sorting it then using a while statement to tell me when the array is empty and it still doesn't work. It is very odd because it will only show the first and the last entry and not the ones in between.
How can I do this?
Thanks SO MUCH!!!!
Brad Taylor
brad at getcoded dot net