title: Creating a directory using PHP
body: <p>I am trying to create a directory with that will create a folder for each month. I would like my directory to be setup like this. Root\subfolder\month . Inside the month folder will be a daily report that will get generated. The problem that I have when i code this is i receive a syntax error saying that there is an uexpected '\' (T_NS_SEPARATOR). The code that i have for this looks like this.</p>
  
  <pre><code>$month = date('M');
  file('Driver Check In\Void\'.$month. '\Void_'.date('m-d-y').".csv");
  </code></pre>
  
  <p>I also have code that will create the month folder if it does not exist. </p>
  
  <p>How can I resolve this issue?</p>
  
  <p>Full Code</p>
  
  <pre><code>if(isset($_POST['Void']))
  {
      $month6 = date('M');
      $fp6 = file('Driver Check In\Void\\'.$month6. '\Void_'.date('m-d-y'). '.csv');
      $header6 = array("Date", "Customer", "Location/City", "Driver", "Cases", "Bottles", "Reason", "Comment");
      $dates6 = $_POST['dates6'];
      $customer2 = $_POST['customer2'];
      $location2 = $_POST['location2'];
      $driver6 = $_POST['drivers6'];
      $cases6 = $_POST['cases6'];
      $bottles6 = $_POST['bottles6'];
      $reason2 = $_POST['reason2'];
      $comment2 = $_POST['comment2'];
      $result6 = '';
      $search6 = "Date";
      $line_number6 = false;
  
      while(list($key6, $line6) = each ($fp6) and !$line_number6)
      {
          $line_number6 = (strpos($line6, $search6) !== FALSE);
      }
      if($line_number6)
      {
          $result6 .=
                      $dates6. " ,". $customer2. " ,". $location2. " ,". $driver6. " ,". $cases6. " ,". $bottles6. " ,". $reason2. " ,". $comment2. "\r\n";
      }
      else
      {
          $result6 .= implode(",", $header6). "\r\n".
                      $dates6. " ,". $customer2. " ,". $location2. " ,". $driver6. " ,". $cases6. " ,". $bottles6. " ,". $reason2. " ,". $comment2. "\r\n";
      }
      if(!is_dir('Driver Check In\Void\\'.$month6))
      {
          mkdir('\Driver Check In\Void\\'.$month6);
      }
      file_put_contents('Driver Check In\Void\\'.$month6. '\Void_'.date('m-d-y'). ".csv", $result6, FILE_APPEND);
      echo "data added6";
  
  
  }
  </code></pre>