我試圖從HTML字符串中提取所有img標籤。看到代碼PHP preg_match_all什麼也沒有返回
$d1 = file_get_contents("http://itcapsule.blogspot.com/feeds/posts/default?alt=rss");
preg_match_all('/<img[^>]+>/i',$d1,$result);
print_r($result);
,其結果是
Array ([0] => Array ())
但同樣的正則表達式給出正確的結果在網上正則表達式測試工具http://regex.larsolavtorvik.com/。
可能是什麼問題?
謝謝,讓我試試 – Orion 2010-02-28 20:11:53