title: An alternative way of getting the file extension of a user uploaded image in PHP?
body: <p>I'm trying to get a file extension of a user uploaded image, I have learnt that several approaches exist to achieve this goal. I think this is currently the conversational way of getting the file extension:</p>
  
  <pre><code>$ext = pathinfo($_FILES["userfile"]["name"], PATHINFO_EXTENSION);
  </code></pre>
  
  <p>However, I find the following method to be more intuitive and memorable: </p>
  
  <pre><code>list(,$ext) = explode("/", $_FILES["userfile"]["type"]);
  </code></pre>
  
  <p>What are the drawbacks of taking the latter approach?</p>