This is my code
$file_string = file_get_contents('http://wiki.teamliquid.net/starcraft2/ASUS_ROG_NorthCon_2013');
preg_match_all('/<th.*>.*Organizer.*<a.*>(.*)<\/a>/msi', $file_string, $organizer);
if (empty($organizer[1])) {
echo "Couldn't get organizer \n";
$stats['organizer'] = 'ERROR';
}
else {
$stats['organizer'] = $organizer[1];
}
I'm trying to get the "Organizer" field from the right-hand "League Information" box on http://wiki.teamliquid.net/starcraft2/ASUS_ROG_NorthCon_2013 but it isn't working.
However (and this is what I don't understand), when I copy the HTML from the page and change the $file_string variable to this:
$file_string = '<tr>
<th valign="top"> Organizer:
</th>
<td style="width:55%;"> <a rel="nofollow" target="_blank" class="external text" href="http://www.northcon.de/">NorthCon</a>
</td></tr>';
The regexp works. Perhaps it could be JavaScript or something? However, I'm able to extract the data of pretty much all of the other rows in the same box, using regexp. I swear I'm missing something obvious here, maybe I just need a set of fresh eyes?
infinite more html
`