Jond2 Posted February 20, 2009 Share Posted February 20, 2009 Ok, so I'm developing an application which needs to be able to grab prices from the Grand Exchange. Much like the Tip.it Item's database currently does. Here is my code so far: <?php $ch = curl_init(); $id = "9004"; curl_setopt($ch, CURLOPT_URL, "http://itemdb-rs.runescape.com/viewitem.ws?obj=".$id); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); curl_close($ch); $string = $output; if(preg_match("/price+(?=:)/", $string, $match)) { print_r($match); }else{ echo 'No match found'; } ?> My problem is that it displays the $match as an array. I'm not really a PHP wizard so I need to know how I would 'Fetch' the infomation from the Array. Any help would be much appreciated. Thanks, Jon. Link to comment Share on other sites More sharing options...
sloter Posted February 20, 2009 Share Posted February 20, 2009 Why was it necessary for you to make a new topic when there is one already started over this? I posted a possible solution here. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now