This article for you to share the 9 kinds of PHP to obtain file suffixes for your reference, the details are as follows
<?php/** * Created by Phpstorm. * User:liuft * DATE:2016/3/7 * time:15:46///First//function get_extension ($file)//{//$file = Explode ('. ', $
file);
Return end ($file); //second//function get_extension ($file)//{//Return substr (STRRCHR ($file, '. '), 1);/////third//function Get_extension ($file) {//return PathInfo ($file) [' extension '];//}///Fourth//function get_extension ($file)//{//R
Eturn substr ($file, Strrpos ($file, '. ') + 1);
//Fifth//function get_extension ($file)//{//$file = Preg_split ('/\./', $file);//Return End ($file);////Sixth
function Get_extension ($file) {//$file = Strrev ($file);//Return Strrev (substr ($file, 0,strpos ($file, '. ')); Seventh//function get_extension ($file)//{//Return PathInfo ($file, pathinfo_extension);//}///eighth type//FUNCTI On Get_extension ($file)//{//Preg_match_all ('/\.[
a-za-z0-9]+/', $file, $data);
return!empty ($data [0]) substr (end ($data [0]), 1): '; }//NinethKind//function get_extension ($file) {//Return Str_replace ('. ', ', ', STRRCHR ($file, '. '))
= "HTTP://10.31.63.8:8081/M00/00/09/CH8_CFAAMLQAO87JAACEPVS0ZRK.WEBP";
$data = Get_extension ($file);
Var_export ($data);
The above is the entire content of this article, I hope to help you learn.