I was trying to extract table where class is snapshot-table2
It return empty blank page.
Wondering what’s wrong?
$output = file_get_contents('http://finviz.com/quote.ashx?t=ROK&ty=c&ta=1&p=d&b=1');
$ismatch= preg_match('|<table width="100%" cellpadding="3" cellspacing="0" border="0" class="snapshot-table2">(.*?)</table>|si', $output, $matchresult);
if($ismatch)
{
echo '<pre>';
print_r($matchresult);
echo '</pre>';
//$processpeg= $matchresult[0];
}
exit;
Make sure
allow_url_fopenis enabled so you can use a URL as a parameter tofile_get_contents. Test if it is: