Monday, October 9, 2017

get list of all file in php project

get list of all file in php project

Sacndir functions are used to get list of file in php project

<?php
$dir    = 'application';
$files1 = scandir($dir);

print_r($files1);

?>


The above example give the following output

Array
(
    [0] => .
    [1] => ..
    [2] => cache
    [3] => config
    [4] => controllers
    [5] => core
    [6] => errors
    [7] => helpers
    [8] => hooks
    [9] => index.html
    [10] => language
    [11] => libraries
    [12] => migrations
    [13] => models
    [14] => third_party
    [15] => views
)


No comments:

Post a Comment

Featured Post

What is JavaScript? What is the role of JavaScript engine?

  The JavaScript is a Programming language that is used for converting static web pages to interactive and dynamic web pages. A JavaScript e...