Return to Snippet

Revision: 58283
at July 5, 2012 23:35 by ne7son


Initial Code
<?php 
function recurly_list($path){
		$arrobiect = scandir($path);
		$arrname[0]=1;
		foreach($arrobiect as $name){
			if(($name == '.') || ($name=='..')){
				
			}else{
				
				if(is_dir($path.'\\'.$name)){
					
					$arr = recurly_list($path.'\\'.$name);
					unset($arr[0]);
					$arrname = array_merge($arrname, $arr);
				}else{
					
					array_push($arrname, $path.'\\'.$name);
					
				}
				$i++;
			}
			
		}
		
		return $arrname;
}


$val = recurly_list('c:\\xampp\htdocs');
print_r($val);

?>

Initial URL

                                

Initial Description
list all files in directory and subdirectory

Initial Title
list all files in directory

Initial Tags
list, file, directory

Initial Language
PHP