0
我們在我們的網站上使用蝰蛇留言並獲得以下錯誤消息:的preg_match():沒有結束符
[20-Jun-2015 12:01:40 UTC] PHP Warning: preg_match(): No ending delimiter '/' found in /home/...../...../gb/index.php on line 277
[20-Jun-2015 12:01:40 UTC] PHP Warning: preg_match(): No ending delimiter '/' found in /home/....../...../gb/index.php on line 278
這些線是:
(!preg_match("/^".PFIX."CUSTOM",$_key)) &&
(!preg_match("/^".PFIX."RATING",$_key))) {
完整的代碼是:
$_b = true;
foreach ($arg as $_key => $_val) {
if ((!in_array($_key,$_paramlist)) &&
(!preg_match("/^".PFIX."CUSTOM",$_key)) &&
(!preg_match("/^".PFIX."RATING",$_key))) {
if (is_array($_val)) {
foreach ($_val as $_inkey => $_inval) {
$_param .= "&".urlencode($_key)."[".
urlencode($_inkey)."]=".urlencode($_inval);
}
}
else {
$_param .= "&".urlencode($_key)."=".urlencode($_val);
}
}
elseif ($_key != PFIX."decode")
$_b = false;
}
結尾分隔符'/'應該在這段代碼中?
請幫忙。
謝謝。
Lakshmanan
假設你是不是想匹配一個'/'一開始,它會在表達式的末尾:'「/^".PFIX."RATING/ 「'您的正則表達式分隔符是基於模式的第一個字符的'/',所以您需要以相同的字符結束模式。 –