ereg()
| From: | Ben Quinn | Date: | Tue, 28 Aug 2001 07:46:54 +0000 |
| Subject: | ereg() | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-64741@lists.php.net to get a copy of this message | ||
Hi all
Say i had text similar to below
Cairns Fine
Mareeba Fine
Innisfail Fine
I'm using the following code to grab the weather forecast for each of those
towns
$GrabURL = "forecast_map_data.txt";
$GrabStart = "PROVINCIAL CITY";
$GrabEnd = "UV ratings";
$file = fopen("$GrabURL", "r");
$rf = fread($file, 20000);
$grab = eregi("$GrabStart(.*)$GrabEnd", $rf, $show);
eregi("Cairns(.*)Mareeba", $show[1], $cairns);
which works fine, but when i then try to grab the forecast for Mareeba using
this
eregi("Mareeba(.*)Innisfail", $show[1], $mareeba);
nothing happens - i figure it's because i've already use Mareeba as a stop
point. Can anyone recommend a function or a way to do this where i'll be
able to use the same start or stop text more than once?