I know, I know, this sounds soo easy. But I can\'t seem to find the correct answer on the Internet.
One of the solution I found was to use i
i
You could try this:
if(is_dir($dir) && is_writeable($dir)) { // ... }