Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
PHP list directory content
SUBMITTED BY:
Guest
DATE:
Oct. 23, 2013, 9:12 a.m.
FORMAT:
PHP
SIZE:
467 Bytes
Raw
Download
Tweet
HITS:
1101
Go to comments
Report
<?php
function
list_directory_content
(
$dir
){
if
(
is_dir
(
$dir
)){
if
(
$handle
=
opendir
(
$dir
)){
while
((
$file
=
readdir
(
$handle
))
!==
false
){
if
(
$file
!=
'.'
&&
$file
!=
'..'
&&
$file
!=
'.htaccess'
){
echo
'<a target="_new" href="'
.
$dir
.
$file
.
'">'
.
$file
.
'</a><br>'
.
"
\n
"
;
}
}
closedir
(
$handle
);
}
}
}
?>
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus