Although this code is short, it is very practical. It can easily create a hyperlink to the file with the specified suffix name in the directory you specify, and it can be set so that the homepage of the specified directory will not be navigated.
function navbar(){
$files = dir("."); //Specify directory
$pipe = " | "; //Pipe character
//Search all files in the directory through the following loop
while ($current = $files->read()) {
//ignor all files not of htm type.
if (strpos ($current, "php")!= FALSE) //Set files with the suffix PHP to be navigated
//Ignore itself (such as index.html)
{ if (strpos($current, "ndex ") == FALSE)
> print "";
print $pipe; >
http://www.bkjia.com/PHPjc/316316.html
www.bkjia.com
true
http: //www.bkjia.com/PHPjc/316316.html