Check if directory have sub-directories PHP -


i trying file in directory. operation must fast.the inital directory can have childrens path/child/sub_child/sub_sub_child/afile. file can present before

  • path

    • child
    • a file

    i not care file getting want fast way it.

i stuck this

        $h = opendir($path); //open current directory         while (false !== ($entry = readdir($h)))          {             if($entry != '.' && $entry != '..')              {                  echo $entry;                  break;              }         } 


Comments

Popular posts from this blog

symfony - InvalidConfigurationException in SecurityExtension.php line 429: No authentication listener registered for firewall "secured_area" -

angular ui router - 10 digest iterations reached in angularjs when using $state.go -

javascript - Handling constructor related functions while testing with mocha and sinon -