I'm looking for a way to test on a portion of a RecursiveDirectoryIterator's object output. I know how to identify a folder, but I am new to php and unfamiliar with how to look at the contents of the folder object's path... Is this possible?
I have the following:
foreach($files as $object){
$indent = str_repeat(' ', $files->getDepth());
if($object->isDir()){
//I know this is wrong... here is where I would want to find the string:
if($object contains 'mystring')){
echo "%%%-------found the string!\n";
}else{
echo $indent, "|| dir: $object\n";
}
}else{
echo $indent, "-- $object\n";
}
}