/** * * 五种方法获取文件扩展名 **/ $file_name="aa.txt"; echo strrchr($file_name, ‘.‘); echo ‘<hr/>‘; echo substr($file_name, strrpos($file_name, ‘.‘)); echo ‘<hr/>‘; $arr=explode(‘.‘,$file_name); echo array_pop($arr); echo ‘<hr/>‘; echo pathinfo($file_name)[‘extension‘]; echo ‘<hr/>‘; echo strrev(substr(strrev($file_name), 0, strpos(strrev($file_name), ‘.‘)));
原文地址:https://www.cnblogs.com/huay/p/10368049.html
时间: 2024-10-10 08:47:56