- 五种方法获取文件扩展名
$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), '.')));
echo '<hr/>;
echo strstr($file_name,'.');