note 86139 added to function.scandir

From: Date: Sun, 05 Oct 2008 12:25:46 +0000
Subject: note 86139 added to function.scandir
Groups: php.notes 
Request: Send a blank email to php-notes+get-145066@lists.php.net to get a copy of this message
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

« previous php.notes (#145066) next »