I just can’t seem to work out how to pull the entire table from a page using regex.
This is my PHP:
$printable = file_get_contents('http://entertainment.soundboxaudio.com/testplaylist.htm');
$array = array();
preg_match( '/<TABLE>(.*?)<\/TABLE>/si', $printable, $array ) ;
$findit = "$array[1]";
echo("$findit");
Any help would be appreciated,
Thanks!
Here we go again… do NOT use regex to extract HTML. HTML is not a regular language and cannot be reliably analyzed with a regex. Use DOM instead.
As well, surrounding variables you’re echoing is just a waste of a string operation
work identically, except the quoted version wastes some cpu produce a temporary string that only gets thrown away again.