rmdir() displays a few warnings like the dir does not exist, or permissions did not allow. How can I capture which reason for failure and react to it?
Share
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.
rmdir does not throw Exception so you cannot catch them with try/catch. What you can do is use error_get_last function to do what you need.
Try something like this: