note 59072 added to function.readdir

From: Date: Fri, 25 Nov 2005 14:39:01 +0000
Subject: note 59072 added to function.readdir
Groups: php.notes 
Request: Send a blank email to php-notes+get-99082@lists.php.net to get a copy of this message
to ES: i believe you are mistaken. readdir() returns a string (the filename), not an array therefor, the open_dir function should be like this: function open_dir($dir) { $this->dir = $dir; $handle = opendir($this->dir); if($handle) { while(false !== ($file = readdir($handle)) { if($file != "." && $file != "..") { $files[] = $file; } } sort($files); foreach($files as $file) { echo $file."<br>"; } } } ---- Manual Page -- http://www.php.net/manual/en/function.readdir.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+59072 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+59072&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+59072&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+59072&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+59072&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+59072&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+59072&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+59072&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+59072&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#99082) next »