I need some help reading a file. I need to find one e-mail address out of a text file. I don't know how to do this. I can open the file but how do I find that one e-mail address? Any ideas would be helpful!
regular expressions.
try ereg()...
I don't totaly understand that function... could you explain it a bit more?
you need to take the manual, try a bit with some code...
Thanks so much for the help!
Try something like this:
$my_file = file($filename);
for ($t=0;$tcount($my_file);$t++) {
if (ereg("abc",$my_file[$t]) { print "found it\n"; };
};
Do I have to open the file or can I just do it like you showed?
The function file() opens a file, reads it, and stores the content in an array.
So no, you don't have to specifically open the file.