I have an empty folder called my_folder:
$mas = glob("my_folder/*");
var_dump($mas);
If in my_folder I have files, the result is an array, but if my_folder is empty, the result is false.
Why is the result false and not an empty array()?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Most likely you don’t have permissions on
my_folder.Also it could be because (from PHP manual):
If the latter is your case i suggest you to fall back to “classic” way to do that:
Using: