Originally posted by dalecosp
Awful hack:
<?php
$string="Wind Direction (WDIR)";
$data=file_get_contents("http://www.ndbc.noaa.gov/station_page.php?station=41004");
$foo=explode($string, $data);
$bar=explode("</TD></TR>", $foo[1]);
echo "$string". strip_tags($bar[0]);
?>
😃 [/B]
Awful to you, awesome to me 😃
I managed to change it around a little and produced fantastic results!
I am wondering though, is there a way to only get the data that is between the strings?
This prints: "Wind Direction (WDIR) SW (230 deg true )"
Ideally, what I would like is it to only print the 1st variable and not any of the other information eg only print "SW". I managed to get it to not print "( 230 deg true )", but is there a way to also make it not print "Wind Direction (WDIR)"
I know the variables change, i just used real examples to make it easier to understand, which likley made it more difficult.