I have a php script $filelist = scandir('myfolder/') which list outs files from my folder. But it is adding child folders also to the array so that they are also populated when i print the result using foreach. I want to remove folders from getting added to the array. How can I do this??
I have a php script $filelist = scandir(‘myfolder/’) which list outs files from my
Share
You can use the function glob(), and check if the item of array is_dir().