I have set-up a script to list all the files on a folder. however as the script file is also in the same dir it is listing that too. How would i be able to filter out items from being listed ?![]()
I have set-up a script to list all the files on a folder. however as the script file is also in the same dir it is listing that too. How would i be able to filter out items from being listed ?![]()
Depending on how you're doing it, you can just do something like:
You could probably use the $_SERVER variable to get this, but as long as you don't mind hard coding it, it's all good.PHP Code:
<?php
foreach($files as $file) {
if($file != 'SCRIPT_NAME.php') {
// Do whatever
}
}
?>
Thanks
Bookmarks