...

View Full Version : Show all files with prefix admin-



NumBa1Stunna516
09-17-2005, 12:22 AM
Hey can someone tell me how I can make it show all files in the current folder that have the prefix admin-? Thanks

schleppel
09-17-2005, 01:20 AM
http://uk.php.net/manual/en/function.glob.php


chdir('/full/path/from/root/');//go to the directory
$files = glob('admin-*'); //files into an array

foreach($files as $file)
{
echo $file . "\n";
}

NickCTM
09-17-2005, 04:24 AM
I'd try :


if( ereg("^admin-", $file) ) { //Insert code for shown files }

NumBa1Stunna516
09-18-2005, 04:29 PM
I got it to work with schleppel's code. Thanks guys.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum