1
我使用preg_replace
多個正則表達式,並發現它們單獨工作。一旦我包含多個preg_replace,另一個將停止工作。多個正則表達式
有沒有辦法以有序的方式使用preg_replace
,而不是隻要它加載?
這是我到目前爲止有:
file_put_contents("$uploadedfile", preg_replace("/<[^>]*>/", "", "$filecontents"));
file_put_contents("$uploadedfile", preg_replace('/\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})/', '<em>(\1) \2-\3</em>', $filecontents));
到文件在上面的代碼,第二個會正常運行,但不是第一次,但是如果我刪除第二條語句,第一條語句運行正常。 – Johnk 2013-02-10 13:28:28