- chdir: documentation ( source)
- touch: documentation ( source)
<?php
chdir('/tmp');
touch('test1.php');
touch('test2.php');
touch('test3.php');
$it = new GlobIterator("./*.php");
foreach ($it as $p)
echo $p->getFilename() . " " . ($p->isFile() ? "IS" : "IS NOT") . " a file\n";
$it = new GlobIterator("*.php");
foreach ($it as $p)
echo $p->getFilename() . " " . ($p->isFile() ? "IS" : "IS NOT") . " a file\n";