What is glob in PHP Filesystem

In this article I am going to explain about glob function in PHP.
  • 1177

PHP glob() Function

The filesystem glob function is used to searches for all the pathnames matching pattern according to the glob function.

Syntax of glob function

glob(pattern, flags)

Parameters in glob function

It have two parameter:

Parameter Description
pattern It specifies the pattern to search for.
flags It is optional parameter.

Example of filesystem glob function

<html>

<body>
 

<?php

print_r(glob("*.txt"));

?>
 

</body>

</html>

 

Output:

globfunctionphp.jpg

You may also want to read these related articles :
here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.