title: Message: mkdir(): Invalid argument
body: <p>I have the following code : </p>
  
  <pre><code>$data['user_data'] = $this-&gt;session-&gt;userdata('user');
          $user_id = $data['user_data']["employee_id"];
  
          $f_name = $data['user_data']["f_name"];
          $s_name = $data['user_data']["s_name"];
          $username = $data['user_data']["user_name"];
          $title = $data['user_data']["title"];
          $is_active = $data['user_data']["is_active"];
          $employee_type = $data['user_data']["employee_type"];
          $month = $data['user_data']["month"];
          $year = $data['user_data']["year"];
      $current_month = date('F');
  
              $current_year = date('Y');
  
              $folder_name = $current_month . $current_year;
              $directory = "./files/" . $current_month . $current_year;
  
              $directory_name = dirname($directory);
  
              $last_base_name = basename($directory);
  
              $previous_month = $month.$year;
  
              $folder_name = $previous_month;
            echo 'folder name : ......before checking ....'. $folder_name.'&lt;/br&gt;';
  
  
              $filename = "./files/" . $previous_month . "/";
               echo 'DIRECTORY:   .......'.$filename.'&lt;/br&gt;';
              echo 'File Name' . $previous_month . '&lt;/br&gt;';
              if (!file_exists($filename)) {
                  echo 'Directory doesnt exist' . '&lt;/br&gt;';
                    mkdir("./files/".$previous_month."/", 0777);
  
                  echo "The directory $previous_month was successfully created.";
                  $approved_file_name = "./files/" . $previous_month . "/approved";
                  if (!file_exists($approved_file_name)) {
                      mkdir("./files/" . $previous_month . "/approved", 0777);
                      echo 'The directory approved was created';
                  }
                  $un_approved_file_name = "./files/" . $previous_month . "/un_approved";
                  if (!file_exists($un_approved_file_name)) {
  
                      mkdir("./files/" . $previous_month . "/un_approved", 0777);
                      echo 'The directory un_approved was created';
      }
  </code></pre>
  
  <p>I want to create directory from the  above code e.g March2014 
  When I run the  sccript, I get the following error : 
  Message: mkdir(): Invalid argument 
  please advise what is it that am not doing right? 
  When I try to create the following type of directory e.g March, it is successful </p>