title: Create directory if not exists else move file
body: <p>I have the following code to upload a file:</p>
  
  <pre><code>&lt;?php
  //set the image size in mb
  $max_upload_size='10';
  $MAXIMUM_FILESIZE = $max_upload_size * 1024 * 1024;
  get_current_user();
  global $current_user;
  $uploaddir = './uploads/file/'.$current_user-&gt;user_login.'/'; 
  $file = $uploaddir . basename($_FILES['uploadfile']['name']); 
  if ($_FILES['uploadfile']['size']&lt;$MAXIMUM_FILESIZE) {
  if (move_uploaded_file($_FILES['uploadfile']['tmp_name'], $file)) { 
    echo "success"; 
  } else {
      echo "error";
  }
  }else{
      echo"size_error";
  }
  ?&gt;
  </code></pre>
  
  <p>This works great if the user_login already exists under /uploads/file/ directory. How can I create the directory that is based on variable $current_user->user_login if it doesn't exists? If exists then continue on the next code.</p>