gpt4 book ai didi

php - preg_match() : Compilation failed: missing ) at offset 14 after i upgraded to php7

转载 作者:行者123 更新时间:2023-11-29 11:20:53 25 4
gpt4 key购买 nike

拜托,我需要帮助来解决这个问题。我将服务器升级到 php7 后收到此警告。

} elseif (strlen($phrase) == stripos($phrase, '*') + 1) {
$phrase = str_replace('*', '', $phrase);
$collapsed_phrase = explode(' ', $phrase);
if (count($collapsed_phrase) > 1) {
$pattern = '/\b(' . $phrase . '[a-zA-Z0-9]*)/i';
$res = preg_match_all($pattern, $data['adtitle'], $mass);
}

我错误堆栈指向上面的 block 。提前致谢

最佳答案

问题似乎是 $phrase 中的输入包含特殊字符。为了确保自定义输入不会导致此问题,请始终使用 preg_quote将输入插入正则表达式时。

关于php - preg_match() : Compilation failed: missing ) at offset 14 after i upgraded to php7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38950590/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com