Using pathinfo() function to get file extension
To get a file extension in PHP, pass the file path string and PATHINFO_EXTENSION constant to the pathinfo() function.
For example:
$ext = pathinfo($f...
Using pathinfo() function to get file extension
To get a file extension in PHP, pass the file path string and PATHINFO_EXTENSION constant to the pathinfo() function.
For example:
$ext = pathinfo($file, PATHINFO_EXTENSION);
When uploading a file via HTML form, get the file name from $_FILES array.