Array questions
Posted: Fri Jul 28, 2006 11:34 am
I have two problems with my php script that lists files in a directory, it shows blank filesnames for some of the listing (why?). And, with the webbrowser I use to display the directory list, it cant show all of the listing (no scrolling is allowed in this program) so I need to split the array into 3 parts so I can have 3 columns, each column in a different array and I need to remove the empty filenames from the array. So far I have:
And yes, it removes .mp3 from the name before displaying it, This is for a special program.
How can I split $newfile into 3 arrays?
Code: Select all
<?
$path = "/homepages/21/d155481990/htdocs/server";
$dir_handle = @opendir($path) or die("Unable to open $path");
while ($file = readdir($dir_handle))
{
if($file!="." && $file!=".." && $file!="")
$newfile = str_replace(".mp3", "", $file);
echo "$newfile<br/>";
}
closedir($dir_handle);
?>How can I split $newfile into 3 arrays?