… a long time ago 2015-03-28 11:58 @ php.net (this is just a copy for me)
In this documentation page i see things for to hide hidden files (also for opendir() or readdir() …. this should be mentiond all there
<?php // not hidden but on most OS systems Win, *nix, OSX.. if ($file == '.' || $file == '..') { // "." current dir info, // ".." dir above info, continue; # or <?php if $name[0] === '.' // NOT OK FOLKS
Think:
„… and then came Polly.avi“ is the title of the Movi. What do you do then?
Windows does it different with hidden files than unix based systems.
For unix based systems something like this should work:
<?php if (preg_match('/^(\.\w+|\.$|\.\.$)/i', $location)) { /* is hidden: . .. .dir .file */ } // must be ok: "..some thing", "... some thing"
I know you do it (if $name[0] === ‚.‘ ) because it is much faster. But it is NOT correct and some day you miss things like me today 🙂
Schreibe einen Kommentar
Du musst angemeldet sein, um einen Kommentar abzugeben.