Created
April 16, 2012 12:40
-
-
Save TCotton/2398519 to your computer and use it in GitHub Desktop.
Rescursivly find file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function find_files($path, $file) { | |
$path = rtrim(str_replace("\\", "/", $path), '/').'/*'; | |
foreach (glob($path) as $fullname) { | |
if (is_dir($fullname)) { | |
find_files($fullname, $file); | |
} else { | |
if (preg_match($file, $fullname)) { | |
//print preg_replace("/\/$/", "", $fullname); | |
include_once (preg_replace("/\/$/", "", $fullname)); | |
} // end if preg_match | |
} // end is_dir | |
} // end foreach | |
} | |
find_files(getenv("DOCUMENT_ROOT"), '/EpiCurl.php/'); | |
find_files(getenv("DOCUMENT_ROOT"), '/EpiOAuth.php/'); | |
find_files(getenv("DOCUMENT_ROOT"), '/EpiTwitter.php/'); | |
find_files(getenv("DOCUMENT_ROOT"), '/register.php/'); | |
find_files(getenv("DOCUMENT_ROOT"), '/tweetpost.php/'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment