Curt Zirzow wrote in message:

> This exact thing was talked about earlier today, with the subject
> 'Using eregi_replace()'.
........................

Right.

However, I've tried using the following code in which the text from the URL
is printed out completely and then I change the variable from $contents to
$text and using the line with preg_replace(), it still outputs the complete
text without the pattern match.

Any advice will be helpful.
Thank you.
TR
............................

<?
$theurl="http://weather.noaa.gov/pub/data/summaries/regional/ny/albany.txt";;
if (!($fp=fopen($theurl, "r")))
 {
  echo "Could not open the URL.";
  exit;
 }
$contents=fread($fp, 1000000);
fclose($fp);
echo $contents;
echo "<br>";
$text=$contents;
$newtext= preg_replace("!.*?(REGIONAL.*YORK).*!","$1",$text);
echo $newtext;  // outputs the same text as above
?>
..............................



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to