PHP create folder with specific path and permissions -


i need way in php create folder if not exist.

so code have first read available folders, if specific folder not exist should create it.

the logic of code be:

$foldername = "user1";  if($foldername exists) { exit; }else{ create folder $foldername , chmod 777 } 

how php , linux server + apache?

$foldername = "user1";  if ( !file_exists($foldername) ) {     mkdir($foldername); } 

in if statement check if folder not exist (yes - file_exists function) , if not, create folder.

777 chmod default.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -