<?$name = "/var/www/upload/a.rar"$ext = strtolower( end( explode('.', $name) ) );//就是按照 . 分割成数组,并取出数组最后一个元素。