forked from 20xd6/simple_blog
Remove depracated PHP for issue #7
This commit is contained in:
parent
b7688ae2d4
commit
3e169d54ed
@ -1,36 +0,0 @@
|
||||
<table border="1" class="pmenu">
|
||||
<tr>
|
||||
<td><a href=/>Home</a></td>
|
||||
</tr>
|
||||
<?php
|
||||
$dir = '.';
|
||||
// Check if the directory exists
|
||||
if (file_exists($dir) && is_dir($dir) ) {
|
||||
// Get the files of the directory as an array
|
||||
$scan_arr = scandir($dir);
|
||||
$files_arr = array_diff($scan_arr, array('.','..','index.php','common','.htaccess') );
|
||||
// echo "<pre>"; print_r( $files_arr ); echo "</pre>";
|
||||
// Get each files of our directory with line break
|
||||
foreach ($files_arr as $file) {
|
||||
//Get the file path
|
||||
$file_path = "./".$file;
|
||||
// Get the file extension
|
||||
$file_ext = pathinfo($file_path, PATHINFO_EXTENSION);
|
||||
if ($file_ext=="php" || $file_ext=="html" || $file_ext=="htm" || $file_ext == "") {
|
||||
$file_array[] = $file;
|
||||
}
|
||||
}
|
||||
foreach($file_array as $file) {
|
||||
$_replace = array('.php', '.html', '.htm');
|
||||
$link_title = str_replace('_',' ',$file);
|
||||
$link_title = str_replace($_replace,'',$link_title);
|
||||
$link_title = ucwords($link_title);
|
||||
echo("<tr><td><a href='$file'> $link_title </a></td></tr>\n");
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "Directory does not exists";
|
||||
}
|
||||
|
||||
?>
|
||||
</table>
|
Loading…
x
Reference in New Issue
Block a user