note 92793 deleted from function.preg-match by cmb
| From: | cmb@php.net | Date: | Sat, 15 Aug 2015 01:24:59 +0000 |
| Subject: | note 92793 deleted from function.preg-match by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-203349@lists.php.net to get a copy of this message | ||
Note Submitter: KOmaSHOOTER at gmx dot de
----
reading files from a dir without "." or ".."
<?php
$handle = opendir('content/pages/');
$pages = array();
while (false !== ($file = readdir($handle))) {
$case=preg_match("/^[.]/",$file,$out, PREG_OFFSET_CAPTURE);
//echo($case);
if(!$case){
echo("$file<br />");
array_push($pages,$file);
}
}
echo(count($pages));
?>