Syntax
array glob (pattern [, int $flags = 0 ] )
It matches the file and directories with the given pattern in the
given path.
After matching with the given pattern it gives an array
consisting of files and directories
<?php
$ar1=glob("*.txt");
foreach($ar1
as $k=>$v
)
{
echo "<br>$k--->$v";
}
?>
Output
0--->aa.txt
1--->bb.txt
2--->roseindai.txt
3--->roseindia.txt
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.