samtwilliams Posted February 16, 2010 Share Posted February 16, 2010 Hi All, I have just created a script to grab a leader board from a website, but for some reason i am getting special characters appearing between forename and surname. How would i go about stripping these out. Below is the result and code. Thanks Sam <?php // lets rock $curl = curl_init(); // Set my url curl_setopt($curl, CURLOPT_URL, 'http://scores.europeantour.com/default.sps?pagegid={7991C900-B8A2-4C34-B856-343079885E16}&redirectorid=tournament_live&eventid=2010006&infosid=2'); // Curl to get headers //curl_setopt($curl, CURLOPT_HEADER, 1); // Tell it not to dump but store curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); //go go go $data = curl_exec($curl); //im done curl_close($curl); //kind of crap but no other way to do it lets max the cpu for a split second. if (preg_match("/<div id=\"scoresBoard2\">(.*)<p class=\"printText\"/s", $data, $matches)) { echo $matches[1]; } ?> Current result set: http://www.prentongolfclub.co.uk/ept/ Link to comment https://forums.phpfreaks.com/topic/192274-special-characters-need-stripping-from-a-curl-grab/ Share on other sites More sharing options...
samtwilliams Posted February 16, 2010 Author Share Posted February 16, 2010 ALL FIXED. I need to set the characterset of the webpage using a metatag. Sam Link to comment https://forums.phpfreaks.com/topic/192274-special-characters-need-stripping-from-a-curl-grab/#findComment-1013232 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.