Question: how to check if directory already exists in php?
Answer: is_dir($filename)) echo $filename, " is not a directory"; else echo "Directory ", $filename, " already exists"; file_exists checks if the path/file exists and is_dir checks whether the given filename is a directory. You need to use mkdir() to actually make the directory.