What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » [SOLVED] PHP file_exists complex!

[SOLVED] PHP file_exists complex!
Author: Message:
prashker
Veteran Member
*****


Posts: 5109
Reputation: 104
– / Male / –
Joined: Mar 2005
Status: Away
O.P. [SOLVED] PHP file_exists complex!
Folder Structure

/home/admin/Downloads/Downloading/Back.To.The.Future
/home/admin/Downloads/Forward.To.The.Past


php code:
//Directories to search
$monitor = array(
'/home/admin/Downloads/Downloading/',
'/home/admin/Downloads/',
'/home/admin/ThirdFolder/'
);

//Looking for $release
$release = array('Back.To.The.Future','Forward.To.The.Past','NonExistingFolder');


foreach ($monitor as $path) {
  foreach ($release as $name) {

    if (file_exists($path . $name)) {
      echo $name . ' exists in ' $path;
    }
  }
}

In my mind, I am expecting an output of


Back.To.The.Future exists in /home/admin/Downloads/Downloading/
and
Forward.To.The.Past exists in /home/admin/Downloads/

What I want to add to this code is the following
If $name does not exist in ANY of the $monitor folders, $delete[] = $name;

In which case, $delete[0] would be NonExistingFolder

This post was edited on 03-27-2010 at 07:12 PM by prashker.
03-27-2010 04:34 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[SOLVED] PHP file_exists complex! - by prashker on 03-27-2010 at 04:34 PM
RE: PHP file_exists complex! - by Mnjul on 03-27-2010 at 04:48 PM
RE: PHP file_exists complex! - by prashker on 03-27-2010 at 05:30 PM
RE: PHP file_exists complex! - by Mnjul on 03-27-2010 at 06:20 PM
RE: PHP file_exists complex! - by prashker on 03-27-2010 at 07:11 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On