Re: [請益]如何抓取html某tag中的資料

看板PHP作者 (michaelz)時間15年前 (2008/09/24 07:13), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/3 (看更多)
※ 引述《meccachen (禾呈)》之銘言: : 例如要抓出XXX及OOO : <tag> : XXX : </tag> : ... : .... : <tag> : OOO : </tag> 如果只是單層的話 可以試試regex $matches = array(); preg('/<tag>(.*?)<\/tag/', $html, $matches); print_r($matches[1]); -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 203.73.248.252
文章代碼(AID): #18sNWOmv (PHP)
文章代碼(AID): #18sNWOmv (PHP)