核心代码
function get_file_suffix($file_name, $allow_type = array())
{
$file_suffix = strtolower(array_pop(explode('.', $file_name)));
if (empty($allow_type))
{
return $file_suffix;
}
else
{
if (in_array($file_suffix, $allow_type))
{
return true;
}
else
{
return false;
}
}
}
上面的对于php5.3以上的版本会报错Strict Standards: only variables should be passed by reference in。所以考高分网小编换了如下方法
如此就解决了,希望大家以后多多支持考高分网。



