Home / CSE / PHP - CS :: Discussion

Discussion :: PHP - CS

  1. Which one of the following PHP functions can be used to find files?

  2. A.

     glob()

    B.

     file()

    C.

     fold()

    D.

     get_file()

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    Here is an example-

    // get all php files AND txt files

    $files = glob('*.{php,txt}', GLOB_BRACE);

    print_r($files);

    /* output looks like:

    Array

    (

    [0] => phptest.php

    [1] => pi.php

    [2] => post_output.php

    .

    .

    .

    )


Be The First To Comment