Jump to content

Check if a list of directories exist from Array()


acid.waste

Recommended Posts

$arr = array('../', 'j/', 'AcidBB/', 'fileBOMB/', 'OurHome', 'up');
foreach ($arr as $value) {
    // echo "Value: $value<br /><br />";
if (is_dir($value)) {
	echo "<tr> <td>{$value}</td> <td><font color='#66FF33'>Exists</font></td></tr><br />";
} else {
	echo "<tr> <td>{$value}</td> <td><font color='#FF0000'>Does Not Exist</font></td></tr><br />";
}
}

~~~ Solved after posting. Sorry. ~~~

Ok i have an Array of directories i need to check before the script installs itself, I know how to check for directories but i dont know how to scan each array in the list without calling each one seperately in

If() { } Else If { } Else If { }

And so on and so on... My Question is, If a For Statement is neaded, How would i go about checking each string in the Array List?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.