Re: PHP->ASP

From: Date: Fri, 26 Oct 2001 06:02:07 +0000
Subject: Re: PHP->ASP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-72393@lists.php.net to get a copy of this message
Is the PHP code you provided below working, I need something like than and i wonder if i could use it. NOBBY (ps: sorry, i can't show u ASP equiv of it coz I do not know) ----- Original Message ----- From: MrBaseball34 <mrbaseball34@hotmail.com> To: <php-general@lists.php.net> Sent: Thursday, October 25, 2001 9:24 PM Subject: [PHP] PHP->ASP > Can anyone show me the ASP equivalent to this PHP code I > cut from a Weather script? I need to know how to get the > response from the server into a string array fo process > each line. > > $weather_url = > "http://iwin.nws.noaa.gov/iwin/tx/hourly.html"; > $city_name = "AUSTIN"; > exec ("$wget_command $weather_url", $raw_contents); > > // We got the weather data we needed, so we can proceeed > > $located = 0; > foreach ($raw_contents as $line) > { > // line may wrap in editor > if (preg_match ("/^$city_name\s+\S+\s+(-*\d{1,3})\s+(\d{1,3})\s+(\d{1,3})\s+ > (\D+)(\d*)\S*\s+(\d{2}\.\d{2})([FRS]{1})/", $line, $regs)) > { > $temp = $regs[1]; > $dewpoint = $regs[2]; > $humidity = $regs[3]; > $wind_direction = trim($regs[4]); > $wind_speed = $regs[5]; > $pressure = $regs[6]; > $pressurechg = trim($regs[7]); // Falling, Rising, Steady > $located = 1; > break 1; > } > } > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#72393) next »