Return to Snippet

Revision: 38965
at March 17, 2011 23:13 by mikael12


Updated Code
$dir = dir($path);
$files_arr = array();

while (false !== $file = $dir->read()) {
	// Skip index file and pointers
	if(eregi(".php", $file) || substr($file, 0, 1) == ".")
		continue;

	if(file_exists($path . '/' . $file))
		$files_arr[] = $file;
}

Revision: 38964
at March 17, 2011 21:59 by mikael12


Updated Code
$dir = dir($path);
$files_arr = array();

while (false !== $file = $dir->read()) {
	// Skip index file and pointers
	if(eregi(".php", $file) || substr($file, 0, 1) == ".")
		continue;

	if(file_exists($file))
		$files_arr[] = $file;
}

Revision: 38963
at January 11, 2011 04:05 by mikael12


Initial Code
$dir = dir($path);
$counter = 1;
$files_arr = array();

while (false !== $file = $dir->read()) {
	// Skip index file and pointers
	if(eregi(".php", $file) || substr($file, 0, 1) == ".")
		continue;

	if(file_exists($file))
		$files_arr[] = $file;
}

Initial URL

                                

Initial Description
Alternative solution http://php.net/manual/en/function.glob.php

Initial Title
Read directory files to array

Initial Tags

                                

Initial Language
PHP