Hi,
The find command can search within a directory tree:
$dir = dirname(__FILE__);
$cmd = 'find ' . escapeshellarg($dir) . ' -name "*.php" ' .
'-o -type d 2>&1';
exec($cmd, $output, $exitCode);
if ($exitCode != 0) {
throw new Exception("Command \"$cmd\" failed with " .
"exit code $exitCode: " . join("\n", $output));
}
echo "Found " . count($output) . " entries.<br>\n";
As for glob, you can just call it multiple times: once with *.php and
once with the GLOB_ONLYDIR flag.
You could also use opendir/readdir.
On Mar 16, 5:31 pm, "Franz Marksteiner" <franzmarkstei...@gmail.com>
wrote:
Hi folks,
is there a way to negate a glob() pattern?
What I want is to get a tree structure, e.g. all .php files *and* all
directories.
How would I start here?
--
Freundliche Grüße,
Franz Marksteiner