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