note 118255 added to function.scandir

From: Date: Wed, 04 Nov 2015 02:24:56 +0000
Subject: note 118255 added to function.scandir
Groups: php.notes 
Request: Send a blank email to php-notes+get-204081@lists.php.net to get a copy of this message
<?php function glob_recursive($pattern, $flags = 0){ // forked from https://github.com/rodurma/PHP-Functions/ // blob/master/glob_recursive.php $files = glob($pattern, $flags); foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir){ $files = array_merge($files, glob_recursive ($dir.'/'.basename($pattern), $flags)); } return $files; } // $a=glob_recursive('c:/test_directory/'."*.*"); // print_r($a); function dirInfoReGet($s){ $a=glob_recursive($s."*.*"); $ar=glob_recursive($s."**/**"); $arr=array_unique(array_merge($a, $ar)); foreach ($arr as $v) { if (is_dir($v)) { $arra[0][]=$v.'/'; } else { $arra[1][]=$v; } } sort($arra); return $arra; } $a=dirInfoReGet('c:/test_directory/'); print_r($a); ?> http://i.stack.imgur.com/H7UF3.jpg Best regards. ---- Server IP: 72.52.91.14 Probable Submitter: 134.17.136.30 ---- Manual Page -- http://php.net/manual/en/function.scandir.php Edit -- https://master.php.net/note/edit/118255 Del: integrated -- https://master.php.net/note/delete/118255/integrated Del: useless -- https://master.php.net/note/delete/118255/useless Del: bad code -- https://master.php.net/note/delete/118255/bad+code Del: spam -- https://master.php.net/note/delete/118255/spam Del: non-english -- https://master.php.net/note/delete/118255/non-english Del: in docs -- https://master.php.net/note/delete/118255/in+docs Del: other reasons-- https://master.php.net/note/delete/118255 Reject -- https://master.php.net/note/reject/118255 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#204081) next »