title: Php add string variable to the begining of file name before upload it
body: <p>Let's say I have a session variable </p>
  
  <blockquote>
    <p>$username =  $_SESSION['userUid'];</p>
  </blockquote>
  
  <p>Can I add it as a string to the filename before upload it?</p>
  
  <pre><code>if (!empty($_FILES['uploaded_file'])) {
      $allowed = array("video/mp4", "video/webm", "video/ogg");//Allowed types
  
      $file_type = $_FILES['uploaded_file']['type'];
  
      $path = "../videos/";
      $path = $path . basename($_FILES['uploaded_file']['name']);
  
      if (!in_array($file_type, $allowed)) { 
  
          header("location:../add-video.php?lesson=" . $lesson . "&amp;alert=wrongtype");
      }
  
      if (file_exists($path)) {
          header("location:../add-video.php?lesson=" . $lesson . "&amp;alert=alreadyexist");
      } elseif (in_array($file_type, $allowed) &amp;&amp; !file_exists($path)) {
          move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $path);
          echo "The file " . basename($_FILES['uploaded_file']['name']) .
              " has been uploaded"; // if checks are successful upload the file
  </code></pre>
  
  <p>So in the videos directory, I will have something like that: uer345video.mp4</p>