PHP\'s mkdir function only returns true and false. Problem is when it returns false.
If I\'m running with error reporting enabled, I see the error message on the scr
You could use exceptions:
Setup some code like so:
function exception_error_handler($errno, $errstr, $errfile, $errline ) {
throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
}
set_error_handler("exception_error_handler");
And then just do:
try {
mkdir('/somedir');
} catch(ErrorException $ex) {
echo "Error: " . $ex->getMessage();
}
That should do what you want.
If you want to preserve the php error handler, then after that try catch block, just call:
restore_error_handler()