title: Getting an extension of an uploaded file in yii2
body: <p>I'm trying to get an extension of a file during upload but I get an error that path info requires a string:</p>
  
  <p>I have tried: </p>
  
  <pre><code>$path_parts = pathinfo($_FILES['evidence']['name']);
  echo $path_parts['extension'];
  </code></pre>
  
  <p>How can extract file extension, for example <code>jpeg</code>, <code>doc</code>, <code>pdf</code>, etc.</p>