•Try•
Catch

Extract File Extension

PHP Snippet to Extract File Extension

Easily and reliably extract the file extension from a file path. Requires PHP 5.2.0 or later.

$path_parts = pathinfo($input);
return $path_parts['extension']; // since PHP 5.2.0
 

Comments (0)


Add a Comment





Allowed tags: <b><i><br>Comment:


** No RegEx required **

modmore