Hi Reader's,
Welcome to FindNerd, today we are going to discuss What is process to get file extension in PHP ?
There are many ways for getting the file format or extension of any file.
In bellow example you can see how to get the file format/extension of file in PHP ?
<?php
//here define a $Extname variable and call explode()
$Extname= explode('.', $_FILES['image']['name']);// here $Extname will be explode by (.)
//here define $filename variable and call end()
$Fileext = end($Fileext);
?>
So when you will use end() then, the last string will be your's file extension.
0 Comment(s)