note 95913 added to function.scandir

From: Date: Thu, 28 Jan 2010 13:43:11 +0000
Subject: note 95913 added to function.scandir
Groups: php.notes 
Request: Send a blank email to php-notes+get-165436@lists.php.net to get a copy of this message
This is a function to count the number of files of a directory function countFiles($dir){ $files = array(); $directory = opendir($dir); while($item = readdir($directory)){ // We filter the elements that we don't want to appear ".", ".." and ".svn" if(($item != ".") && ($item != "..") && ($item != ".svn") ){ $files[] = $item; } } $numFiles = count($files); return $numFiles; } ---- Server IP: 69.147.83.197 Probable Submitter: 79.157.110.12 ---- Manual Page -- http://www.php.net/manual/en/function.scandir.php Edit -- https://master.php.net/note/edit/95913 Del: integrated -- https://master.php.net/note/delete/95913/integrated Del: useless -- https://master.php.net/note/delete/95913/useless Del: bad code -- https://master.php.net/note/delete/95913/bad+code Del: spam -- https://master.php.net/note/delete/95913/spam Del: non-english -- https://master.php.net/note/delete/95913/non-english Del: in docs -- https://master.php.net/note/delete/95913/in+docs Del: other reasons-- https://master.php.net/note/delete/95913 Reject -- https://master.php.net/note/reject/95913 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#165436) next »