Hi Reader's,
Welcome to FindNerd, today we are going to discuss how to use glob() function in php ?
Basically the glob() function is used for returning an array of filenames or directories matching a specified pattern.
The glob() function returns "TRUE" on success and "FALSE" on failure.
Syntax of glob() function
glob(pattern,flags)
you can see below example:
<?php
//here call glob() and print result
print_r(glob("*.php"));
?>
The output of the code above will be:
Array ( [0] => index.php [1] => test1.php )
0 Comment(s)