我具有以下错误:错误类型 - 2:的preg_replace()[function.preg替换]:编译失败:错过)
错误类型 - 2:的preg_replace()[function.preg替换]:编译失败:缺少)偏移量25:在/var/www/hosting/com/galerielaboratorio/scripts/functions.php线766
下面是函数:
function getThumbName($photo, $name = 'thumb') {
$ext = preg_replace ("/.*\./", "", $photo);
$photo = preg_replace ("/\.". $ext ."$/", "" , $photo). "." . $name . "." .$ext; // this line causes the error
return $photo;
}
谢谢在adva帮助NCE。