php upload file get extension code example Example: php get uploaded file extension $ext = pathinfo($_FILES["file"]["name"], PATHINFO_EXTENSION);