0
我的PHP代码行,我需要改变替换的preg_match()语法错误eregi()
while (eregi("([-]?)\"([^\"]+)\"", $a, $regs)) {
到
while (preg_match("([-]?)\"([^\"]+)\"", $a, $regs)) {
和
if (strlen($word) < $min_word_length || (!eregi($pattern, remove_accents($word))) || ($common[$word] == 1)) {
到
if (strlen($word) < $min_word_length || (!preg_match($pattern, remove_accents($word))) || ($common[$word] == 1)) {
我尝试了所有可能的(我可以)组合,我在谷歌搜索和这里也找不到。
你没有使用分隔符....你可以看到手册http://www.php.net/manual/en/regexp.reference.delimiters.php。试试这个” /([ - ]?)\ “([^ \”] +)\ “/” – laurac
@laurac感谢您的建议,您的书面线只是工作完美。你能否写下第二行呢? – Anuj
检查答案:) – laurac