Forum Moderators: coopster
I'm using this code which outputs the total number of files in the specified directory and provides a link to each one.
<?php
$directory = opendir("../directory/");
while($item = readdir($directory)){
if(($item != ".") && ($item != "..")){
$files[] = $item;
echo "<a href=../directory/$dir$item>$item</a><br />";
}
}
$sizeofarray = count($files);
echo "$sizeofarray";
?>
I'd like to modify it so that it doesn't display the file extension in the links?
All of the files will be .php so it would also work if I could not display the last 4 characters.
Does anyone know how to achieve this?
Thanks!