Code: Select all
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_URL, $url); //$url is defined elsewhere
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$content = curl_exec($ch);
curl_close($ch);
sscanf($content, '<span id="Stats_lbl16">%s</span>', $xp);
echo $xp;
?>Code: Select all
$content = '<span id="Stats_lbl16">3244893</span>'; //This line is in the source code of the website I am trying to parse.
sscanf($content, '<span id="Stats_lbl16">%s</span>', $xp);
echo $xp;I believe the problem is with $content. Something along the lines that > is being converted to > or something. I'm not exactly sure, anyone have any insight on this matter?
Thank you