Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Directory To Array
- function dirToArray($dir){
- $result = array();
- $cdir = scandir($dir);
- foreach ($cdir as $key => $value){
- if (!in_array($value,array(".",".."))){
- if (is_dir($dir . DIRECTORY_SEPARATOR . $value)){
- $result[$value] = dirToArray($dir . DIRECTORY_SEPARATOR . $value);
- } else {
- $result[] = $value;
- }
- }
- }
- return $result;
- }
- print_r(dirToArray("."));
- //Get Files Content
- echo file_get_contents('index.php');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement