Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>here ya go, hope it helps:</p> <pre><code>&lt;?php /** * Recursive function that will check all folders in the * requested directory for keywords [$lookfor] [Any extention] * true,false on returning notfounds * * @param $path to folder * @param $lookfor word in filename or folder * @param $showNotfounds [true|false] * @return echo'ed out */ function lookfor($path,$lookfor,$showNotfounds=false){ if(file_exists($path) &amp;&amp; is_readable($path)){}else{die('Error reading folder ./'.$path.'');} if ($handle = @opendir($path)) { while ($file = readdir($handle)){ if ($file=='.' || $file=='..'){}else{ if (is_dir($path."/".$file)){ //Recursive if(stristr($file, $lookfor) === FALSE) { //[folder]missing echo ($showNotfounds==true) ? '&lt;font color="red"&gt;&lt;b&gt;'.$path.'/'.$file.'&lt;/b&gt;&lt;/font&gt;: Not a '.$lookfor.'&lt;br/&gt;': ''; }else{ //[folder]exists echo '&lt;font color="green"&gt;&lt;b&gt;'.$path.'/'.$file.'&lt;/b&gt;&lt;/font&gt;: Is a '.$lookfor.'&lt;br/&gt;'; } lookfor($path."/".$file,$lookfor,$showNotfounds); }else{ if(stristr($file, $lookfor) === FALSE) { //[file]missing echo ($showNotfounds==true) ? '&lt;font color="red"&gt;&lt;b&gt;'.$path.'/'.$file.'&lt;/b&gt;&lt;/font&gt;: Not a '.$lookfor.'&lt;br/&gt;': ''; }else{ //[file]exists echo '&lt;font color="green"&gt;&lt;b&gt;'.$path.'/'.$file.'&lt;/b&gt;&lt;/font&gt;: Is a '.$lookfor.'&lt;br/&gt;'; } } } } closedir($handle); } } //example usage lookfor('.','folder.',true); echo '&lt;hr&gt;'; lookfor('.','poster.',true); echo '&lt;hr&gt;'; lookfor('.','poster.jpg',false); ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload