eregi not working
| From: | Robert Packer | Date: | Sat, 08 Jun 2002 02:48:29 +0000 |
| Subject: | eregi not working | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-101219@lists.php.net to get a copy of this message | ||
Can someone tell me why this isn't working? To me it say open the file, read
it, stick into a variable, close the file. Then search that variable (the
file) and look for the eregi statements. Can someone tell me why this only
gets the first instance of what I'm searching for? Thanks a bunch.
#!/usr/bin/php -q
<?
$site = "proxy.html";
$open = fopen($site, "r");
$contents= fread($open,filesize($site));
fclose($open);
$search=eregi("[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}",
$contents,$array);
echo $array[0];
echo $array[1];
echo $array[2];
?>