Re: php + lynx + grep
| From: | Red Wingate | Date: | Tue, 06 Apr 2004 14:26:58 +0000 |
| Subject: | Re: php + lynx + grep | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-182468@lists.php.net to get a copy of this message | ||
Functions like system, exec etc aren't supported by most ISP ( at least over
here in germany ). But you might give
file_get_contents();
file();
...
a look as they can read the output of HTTP request which might be easier:
$var = file ( 'http://weather.noaa.gov/weather/current/KTOL.html'
);
foreach ( $var AS $line ) {
if ( preg_match( "41-35-19N" , $var ) )
... etc pp
}
good luck,
red
[...]
> lynx --source http://weather.noaa.gov/weather/current/KTOL.html
>
> |grep -v '41-35-19N' |grep TOL | head -n 1
>
> I need to get the output of the above command for a web site I'm
> working on. I've tried exec(), system() and neither seems to
> work.
>
> It's output should be something like this(it changes hourly):
> <TD><FONT FACE="Arial,Helvetica"> KTOL 031452Z 28013KT
> 10SM CLR 10/01 A2977 RMK AO2 SLP086 T01000006 58015
>
[...]