scandir( $path) returns the searched result in array. |
$result = scandir(directory, order, context)
|
<?php
$r = scandir("/etc/");
print_r( $r);
?> |
Below is another example to find files in regexp.
function findfiles( $path, $regex)
{
$r = scandir($path);
} |