Jon_d2
Newcomer
Ok, So i'm developing a script in PHP that will grab the price from the Runescape website of items on the grand exchange. I have completed the HTML grabbing, now all i need to do is scan though the HTML and take out the price. I have a good idea about how to go about doing this, by using regular expressions. But I can't seem to find a way to take out what's infront of "market price:", "maximum price:", and "minimum price:". Here is my script 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("/market price:/i", $string))
{
echo 'Matched Found';
}else{
echo 'No match found';
}
?>
As you can see, I don't have a way to take out the value that comes after the market price.
I have been searching for an answer for about an hour now, and I really need some help. Any help would be greatly appreciated.
Thanks, Jon_d2.
<?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("/market price:/i", $string))
{
echo 'Matched Found';
}else{
echo 'No match found';
}
?>
As you can see, I don't have a way to take out the value that comes after the market price.
I have been searching for an answer for about an hour now, and I really need some help. Any help would be greatly appreciated.
Thanks, Jon_d2.


