Question : php no such file or directory
Answered by : kaniberkali
php file or directory searcher
Source : | Last Update : Mon, 27 Jun 22
Question : php no such file or directory
Answered by : kaniberkali
$results = searchDirToArray($_SERVER["DOCUMENT_ROOT"],"searchVal");
function searchDirToArray($dir,$searchValue) { global $directories; $result = array(); $cdir = scandir($dir); foreach ($cdir as $key => $value) { $path = $dir . DIRECTORY_SEPARATOR . $value; if (!in_array($value,array(".",".."))) { if (is_dir($path)) $result[$value] = searchDirToArray($path,$searchValue); else $result[] = $value; if(str_contains($path,$searchValue)) $directories[]=str_replace("\\","/",$path); } } return $directories; }
Source : | Last Update : Sat, 25 Jun 22