我需要提取的話下面的HTML代碼PHP - 從網頁HTML中提取數據
<div id="tab-soiree" class=""><div class="soireeagenda cat_1">
<a href="/event/83318/" class="lienFly"><img src="http://www.parisbouge.com/img/fly/resize/100/83318.jpg" alt="fiesta erasmus" class="fly"></a>
<ul>
<li class="nom"><h2><a href="/event/83318/">FIESTA ERASMUS</a> </h2></li>
<li class="genre" style="margin-bottom:4px;">
<a href="/soirees-etudiantes/paris/1/" style="color:inherit;" title="soirée étudiante">soirée étudiante</a> </li>
<li class="lieu"><a href="/club/paris/10/duplex">Duplex</a></li> <li class="musique">house, electro, r&b chic, latino, disco</li>
<li class="pass-label">pass</li> </ul>
<a href="/club/paris/10/duplex" title="duplex"><img src="/img/salles/resize/50/10.jpg" alt="duplex" class="flysalle"></a>
<hr class="clearleft">
</div>
FIESTA ERASMUS ANS /事件/ 83318我測試過這樣的事情
$PATTERN = "/\<div id="tab-soiree".*<a href="/event/(.*)/">(.*)</a>/"
preg_match($PATTERN, $html, $matches);
但它不起作用。
[你不能使用正則表達式來解析HTML](http://stackoverflow.com/a/1732454/1185355)所以使用DOM解析器:) – Daan