note 86139 added to function.scandir

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
http://www.php.net/manual/en/function.scandir.php#80057

This note was very helpful. I was testing my code on a local directory (meaning on my E:/ drive) and I realized that the last slash kept being replaced by a forward slash. I added this bit of code to the "scanDirectories" function which determines if this is a local drive or a internet drive and changes the filename separators.

Thanks everyone, I just started using PHP last week (Sept 2008).

 $count_fwdslash = substr_count($rootDir,'/');
 $separator = ($count_fwdslash==0 ? '\\' : '/');
 $path = $rootDir.$separator.$content;
----
Server IP: 69.147.83.197
Probable Submitter: 75.45.183.213
----
Manual Page -- http://www.php.net/manual/en/function.scandir.php
Edit        -- https://master.php.net/note/edit/86139
Del: integrated  -- https://master.php.net/note/delete/86139/integrated
Del: useless     -- https://master.php.net/note/delete/86139/useless
Del: bad code    -- https://master.php.net/note/delete/86139/bad+code
Del: spam        -- https://master.php.net/note/delete/86139/spam
Del: non-english -- https://master.php.net/note/delete/86139/non-english
Del: in docs     -- https://master.php.net/note/delete/86139/in+docs
Del: other reasons-- https://master.php.net/note/delete/86139
Reject      -- https://master.php.net/note/reject/86139
Search      -- https://master.php.net/manage/user-notes.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.