Forum Moderators: coopster
I am hoping this is A) possible and B) easy enough to do.
I am trying to check if a directory exists - if it doesn't I want to make it by using mkdir.
Is this possible? I am still learning and havn't came across working with directories before.
I have searched but not found anything yet except the mkdir() command which I thought was very useful.
You need the is_dir function.
if (!is_dir [uk.php.net]('dir'))
{
mkdir('dir');
}
Or you can use file_exists [uk3.php.net]
dc