How to get the file extension of the form uploaded file in PHP?

Can someone please explain how to get the file extension of the form uploaded file in PHP?

Comments

  • $filepath = $_FILES['image']['name'];
    $fileextension = pathinfo($filepath, PATHINFO_EXTENSION);
    
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion