Hey, I have a page that lists all the stuff in a DIR, but that includes folders. Anybody know a way for me to have it show only files?
Thanks?
HELP! I need to list files but not folders!
Moderator: General Moderators
there is similar post around here (don't know exactly where).
replace the print/echo by
as mentioned in the user contributed notes for is_file you should call clearstatcache to free the memory used for caching the file stats when it's not used anymore.ost around here (don't know exactly where).
replace the print/echo by
as mentioned in the user contributed notes for is_file you should call clost around here (don't know exactly where).
replace the print/echo by
as mentioned in the user contributed notes for is_file you should call [url=http://www.php.net/manual/enost around here (don't know exactly where).
replace the print/echo by
as mentioned in the user contributed notes for is_file you should call clearstatcache to freeost around here (don't know exactly where).
replace the print/echo by
as mentioned in the user contributed notes for is_file you should call clearstatcache[ost around here (don't know exactly where).
replace the print/echo by
as mentioned in the user contributed notes for is_file you should call clearstatcache to free the memory used for cctly where).
replace the print/echo by
as mentioned in the user contributed notes for is_file you should call [url=http://www.php.net/man<?php
if(is_file($name))
print($name);
?>
as mentioned in the user contributed notes for is_file you should call clearstatcache to free the memory used for caching the file stats when it's not used anymore.
replace the print/echo by
Code: Select all
<?php
if(is_file($name))
print($name);
?>replace the print/echo by
Code: Select all
<?php
if(is_file($name))
print($name);
?>replace the print/echo by
Code: Select all
<?php
if(is_file($name))
print($name);
?>replace the print/echo by
Code: Select all
<?php
if(is_file($name))
print($name);
?>replace the print/echo by
Code: Select all
<?php
if(is_file($name))
print($name);
?>replace the print/echo by
Code: Select all
<?php
if(is_file($name))
print($name);
?>replace the print/echo by
Code: Select all
<?php
if(is_file($name))
print($name);
?>if(is_file($name))
print($name);
?>
as mentioned in the user contributed notes for is_file you should call clearstatcache to free the memory used for caching the file stats when it's not used anymore.
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
Code: Select all
<?
$root = "/";
if ($handle = opendir($root)) {
while($file = readdir($handle)) {
if ($file == їa-zA-Z0-p_-]*.php) {
$create = filemtime($file);
$create_2 = date("m/d/Y h:i:s", $create);
echo "what you want to echo";
}
}
closedir($handle);
}
?>if ($file == [a-zA-Z0-p_-]*.php) {
to whaetver you want, and you can also do like
if ($file == [a-zA-Z0-p_-]*.php | $file == [a-zA-Z0-p_-]*.html) {
to include both html or php files...
and then you just echo like a link to the file, $file being the filename...
or do whatever you want,
someone correct my errors if there are any
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact: