note 102583 added to directoryiterator.construct

[email protected] Tue, 22 Feb 2011 17:58:51 -0800
Newsgroups php.notes
Message-ID <[email protected]>
well, using clients it in multiple plattforms standard function are still required!
<?php
$paths = array('/tmp/', 'c:/tmp/');
foreach ($paths as $path) {
foreach (new DirectoryIterator($path) as $file) {
// ...
?>

if you are on *nix systems the windows path 'c:/tmp/' will throw an exception :-/

So check with is_dir() or someting before using it.
----
Server IP: 217.160.235.204
Probable Submitter: 80.171.35.242
----
Manual Page -- http://www.php.net/manual/en/directoryiterator.construct.php
Edit        -- https://master.php.net/note/edit/102583
Del: integrated  -- https://master.php.net/note/delete/102583/integrated
Del: useless     -- https://master.php.net/note/delete/102583/useless
Del: bad code    -- https://master.php.net/note/delete/102583/bad+code
Del: spam        -- https://master.php.net/note/delete/102583/spam
Del: non-english -- https://master.php.net/note/delete/102583/non-english
Del: in docs     -- https://master.php.net/note/delete/102583/in+docs
Del: other reasons-- https://master.php.net/note/delete/102583
Reject      -- https://master.php.net/note/reject/102583
Search      -- https://master.php.net/manage/user-notes.php