This question already has an answer here:
I'm fetching an HTML webpage with file_get_contents()
, I get a table like below, there are more than 150 rows:
<tr class="tabrow ">
<td class="tabcol tdmin_2l">FIRST+DATA</td>
<td class="tabcol">
<a class="modal-button" title="SECOND+DATA" href="THIRD+DATA" rel="{handler: 'iframe', size: {x: 800, y: 640}, overlayOpacity: 0.9, classWindow: 'phocamaps-plugin-window', classOverlay: 'phocamaps-plugin-overlay'}">
asdxxx
</a>
</td>
<td class="tabcol"></td>
<td class="tabcol">FOURTH+DATA</td>
</tr>
I want to get the FIRST DATA
, SECOND DATA
, THIRD DATA
and FOURTH DATA
with a preg_match_all()
call. I tried to write multiple patterns, but I couldn't succeed. Here's what I tried:
preg_match_all('/(<td class="tabcol tdmin_2l">|title=")(.*?)(<\/td>|")/s', $raw, $matches, PREG_SET_ORDER);
What's the true patterns?
</div>