Ezzaral
Posting Genius
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
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 :P
Eko
Junior Poster in Training
60 posts since Nov 2006
Reputation Points: 12
Solved Threads: 1