Extract the file extension using PHP

Extract the file extension of the specified file name / file path using the pathinfo() function.
1. function GetFileExtension($Filepath)
2. {
3.    $PathInf = pathinfo($Filepath);
4.    return $PathInf['extension'];
 5. }

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top