function get_extension($file)
{
substr(strrchr($file, '.'), 1);
}
第2种方法:
function get_extension($file)
{
return substr($file, strrpos($file, '.')+1);
}
第3种方法:
function get_extension($file)
{
return end(explode('.', $file));
}
第4种方法:
function get_extension($file)
{
$info = pathinfo($file);
return $info['extension'];
}
第5种方法:
function get_extension($file)
{
return pathinfo($file, PATHINFO_EXTENSION);
}
相关文章:
-
2022-12-23
-
2021-09-28
-
2022-12-23
-
2022-12-23
-
2022-12-23
猜你喜欢
-
2022-12-23
-
2022-12-23
-
2021-09-03
-
2021-06-01
-
2021-08-16
-
2021-09-27
-
2021-07-19
相关资源
-
下载
2022-12-06
-
下载
2021-06-06
-
下载
2023-01-21