title: PHP how to rename uploaded file?
body: <p>I want to rename file and upload it into server as well as in database. I have a code:</p>
  
  <pre><code>$file = $_FILES['file'];
  list(,$type) = explode('/', $file['type']);
  move_uploaded_file($file['tmp_name'], 'images/'.time().'.'.$type);
  $a = time();
  $b = ($a.'.'.$type);
  </code></pre>
  
  <p>It is working, but I'm not exactly sure how it works. How can I change this <code>'images/'.time().'.'.$type</code> into name of which I want to, for example: <code>'images/'myname.time().'.'.$type)</code> All those dots and quotes are killing me!</p>