title: How can i get full path of uploaded file in php?
body: <p>How can i get Full path of uploaded file in php. As i uploaded a xml file and clicked on submit button full path of uploaded file will be shown on screen.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;form action="index.php" method="post" enctype="multipart/form-data"&gt;
  File: &lt;input type="file" name="fileToUpload" id="fileToUpload"&gt;
  &lt;input type="submit" name="sub" value="Submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>PHP</strong></p>
  
  <pre><code>if(isset($_POST['sub']))
  {
   $file = $_FILES["fileToUpload"]["name"];
   $filename = pathinfo($file);
   $st_name = $filename['filename'];
   $dir= $filename['dirname']; //directory name
   echo $dir;
  }
  </code></pre>
  
  <p>Here as i click on submit button output should be like this...<br></p>
  
  <pre><code>**D://new/folder/file.xml**
  </code></pre>