This code gets the today's gas price
It's easy to get it on this site because the price is placed between a span with the id "GBPS_lblUSToday"
$arr = file("http://www.gasbuddy.com/");
$gasprice = "";
foreach ($arr as $key => $line)
{
if (strstr($line, "GBPS_lblUSToday"))
{
$gasprice=$line;
break;
}
}
echo strip_tags($gasprice);
If you need any help,don't hesitate to ask me
Reputation Points: 12
Solved Threads: 1
Junior Poster in Training
Offline 60 posts
since Nov 2006