Of course, I’ve tried the obvious:
<?php
foreach (new RecursiveIteratorIterator (new RecursiveDirectoryIterator ('.'), RecursiveIteratorIterator::CHILD_FIRST) as $x)
{
echo $x->getPathname (), "n";
}
?>
…Which happens to be the selected answer here. but the problem, of course, is that it doesn’t follow links, even though I’ve configured Apache (my chosen web server) to allow following of links. The links all work, except for this – so far as I am aware.
Here are the results (and yes, I’m in the editor as I run this development code):
./index.php ./. ./.index.php.swp ./..
I’d hate to have to resort to calling an external program for this; is there another (simpler / more efficient) way and if so, what is it?