Thanks for the suggestion Kingbear.
I tried the code as seen below, but I get the following error
Parse error: parse error in /home/virtual/site182/fst/var/www/html/string.php on line 22
Here is the code as I tried it:
<html>
<h1>search program</h1>
<?php
$re = ".[a-zA-Z0-9..-]+@[a-z0-9]+.[a-z]+";
$fp = file("DOCUMENT_ROOT/../sales.txt");
foreach($fp as $index=>$line) {
$entities = split(" ", $line);
for($c = 0; $c < count($entities); $c++) {
if(eregi($re, trim($entities[$c]))) {
echo($entities[$c]);
}
}
?>
</html>
I tried to figure out what the problem was to no avail.