residual Posted November 5, 2007 Share Posted November 5, 2007 <?php $h3tag = $_GET['h3tag']; if (empty($h3tag)) { $h3tag = 'blank'; } $h3tag = str_replace(" ","%20",$h3tag); $ch = curl_init(); $timeout = 5; curl_setopt ($ch, CURLOPT_URL, 'http://duncanmackenzie.net/services/GetXboxInfo.aspx?GamerTag='. $h3tag); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $in1 = curl_exec($ch); curl_close($ch); preg_match('#<Info>(.+?)</Info>#',$in1, $online1); preg_match('#<Info2>(.+?)</Info2>#',$in1, $status1); $online = $online1[1]; $status = $status1[1]; $output = '<div> Online Status: ' . $online . '</div><div> Status: ' . $status . '</div>'; echo $output; ?> This works fine for $online but not for $status. Please anyone any ideas? ??? Link to comment https://forums.phpfreaks.com/topic/76085-parsing-xml-with-pregmatch/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.