我試圖刪除這樣的事情:preg_replace函數刪除不需要的鏈接
<a href="http://women.domain.com">women.domain.com</a>
我認爲這應該是:
$this->tresc[$i][description]=preg_replace("/\<a(.*)href=(\"|')http:\/\/women\.domain\.com.*(\"|')(.*)\/\>/i", "",$this->tresc[$i][description]);
,但它不工作。
因爲我用這個圖片,它的工作完美:
$this->tresc[$i][description]=preg_replace("/\<img(.*)src=(\"|')http:\/\/women\.domain\.com.*(\"|')(.*)\/\>/i", "",$this->tresc[$i][description]);
這樣的:的preg_replace( 「/ <.*> /」, 「你好」,$這個 - > tresc [$ I] [描述]); – 2012-07-07 11:25:11
首先你必須通過附加一個U – 2012-07-07 11:25:56
來制定正則表達式,然後你必須糾正你的正則表達式的尾部,以便識別img標籤 – 2012-07-07 11:27:42