I want to search files and folder in directories and sub directories php -


i want search files , folders in directory or sub-directories.

i'm using code:

  <?php     $a = new regexiterator(     new recursiveiteratoriterator(         new recursivedirectoryiterator('files')     ),     '/desi indian/',     regexiterator::match    );     foreach ($a $v) {     echo "$v\n"; //$v filename    } ?> 

but, problem is, file name 'wayne' , if search string 'wayne', doesn't show search result. ideas?

but, problem , file name 'wayne' , if search string 'wayne', not show search results.

this sounds question of searching case insensitive. regular expressions can given additional processing flags, amongst them i purpose @ hand. replace pattern '/desi indian/i' , should match file names regardless of cases.

you may want read bit flags, or modifiers how called: http://php.net/manual/en/reference.pcre.pattern.modifiers.php


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -