Choffo Posted January 17, 2007 Share Posted January 17, 2007 How can I find out if the folder already exsists?I want to make the script create a new folder if there isn't already a folder with that name. Link to comment https://forums.phpfreaks.com/topic/34543-find-out-if-folder-exsists/ Share on other sites More sharing options...
mjlogan Posted January 17, 2007 Share Posted January 17, 2007 [code=php:0]if (!is_dir($dir)) {mkdir($dir);}[/code]something along those lines should do it. Link to comment https://forums.phpfreaks.com/topic/34543-find-out-if-folder-exsists/#findComment-162705 Share on other sites More sharing options...
vbnullchar Posted January 17, 2007 Share Posted January 17, 2007 [code]$dir="/home/www/projects/";if (!is_dir($dir)) { //not existing... creat dir here}[/code] Link to comment https://forums.phpfreaks.com/topic/34543-find-out-if-folder-exsists/#findComment-162707 Share on other sites More sharing options...
Choffo Posted January 17, 2007 Author Share Posted January 17, 2007 Thanks! :D Link to comment https://forums.phpfreaks.com/topic/34543-find-out-if-folder-exsists/#findComment-162709 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.