title: PHP move_uploaded_file Rename file
body: <p>I know that <code>move_uploaded_file()</code> sets the name of the uploaded file and sets the destination also. I have this:</p>
  
  <pre><code>$sourcePath = $_FILES['file']['tmp_name']; // Storing source path of the    file in a variable
  $targetPath = $_SERVER['DOCUMENT_ROOT'] . '/img/profiles/'.$_FILES['file']['name']; // Target path where file is to be stored
  move_uploaded_file($sourcePath,$targetPath) ; // Moving Uploaded file`
  </code></pre>
  
  <p>I have tried explode <code>$_FILES['file']['tmp_name']</code> but I don't get to change the name of my uploaded file to my POST variable <code>$newfile=$_POST["something"];</code></p>
  
  <p>Thank you in advance</p>