我具有以下錯誤:錯誤類型 - 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。