title: PHP mkdir not working in if statement
body: <p>Why is my <code>mkdir</code> not working within the <code>if(is_dir)</code> function but it is working above it with just the single line?</p>
  
  <pre><code>mkdir($location.$folderName, 0777);
  
              if(!is_dir($folderName))
              {   
                  mkdir($location.$folderName, 0777);
  
              }else{
  
              //Set File Settings 
                $config['upload_path'] = $location.$folderName; 
                $config['allowed_types'] = 'jpg|png|pdf'; 
                $config['file_name'] = $folderName.'_'.$concept;
                $config['remove_spaces'] = TRUE;
                $config['overwrite'] = TRUE;
                $config['max_size'] = '1024'; 
                $config['max_width'] = '1024'; 
                $config['max_height'] = '768'; 
  
                $this-&gt;load-&gt;library('upload', $config); 
  
                  print_r($config);
  
                if(!$this-&gt;upload-&gt;do_upload($conceptOne)) { #= try upload
  
                  $data['uploadError'] = array('uploadError' =&gt; $this-&gt;upload-&gt;display_errors()); #Error
  
                  $this-&gt;load-&gt;view('layout', $data);
  
            } // Do upload
                else{
                  $data = array('upload_data' =&gt; $this-&gt;upload-&gt;data($conceptOne));
  
                }// end else
              }// end if folder
  </code></pre>