Creating folder in root directory

Hi, I need some help how can i create folder in the root directory.

my script for creating the folder is in the folder called folder1, this is the path C:\wamp\www\ABC\folder1

now what i want is to create a folder outside in my “folder1” named “xyz”.

this is the code for creating and checking but the new folder (xyz) will be created inside my folder1 how can i create outside in my folder1


  $folder = 'xyz';
  
  if(!is_dir($folder)){
            mkdir($folder));
       }

Thank you in advance. :slight_smile:

Try:


 $folder = '/xyz';
  
  if(!is_dir(dirname($folder))){
            mkdir(dirname($folder));
       }

Hi, it doesn’t create the folder.

Hi fixed it now…Thank you :slight_smile: