I need to know if there is any way to create new folder if the path doesn\'t exist. When I try to fopen() a path, it says NO such File or Directory exists I tri
NO such File or Directory exists
fopen cannot create directories.
You'll need to use something like:
$filename = '/path/to/some/file.txt'; $dirname = dirname($filename); if (!is_dir($dirname)) { mkdir($dirname, 0755, true); }