title: PHP: fopen to create folders
body: <p>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 <code>NO such File or Directory exists</code> I tried to open the file using 'w' and 'w+' but it is not able to create new folder. Is there any way to achieve it without using mkdir(). Because I need to extract the directory names alone from the path to mkdir() everytime.  Any help is appreciated. Thanks...</p>