Hi guys 🙂
I'm trying to code a function to search a file for an 8 digit number. I don't even know where to start.
Thanks for any help 🙂
Hi,
You are trying to search IN teh file?
Have a look at [man]fopen[/man], [man]fread[/man], [man]strpos[/man]
J.
The problem is the number will be changing. So I can't enter the number I want to search for, instead I just have to search for an 8 digit number.
Make sense?
You'd have to use a regular expression. Look at [man]ereg[/man]
$string = "a string like 50143672 can be detected"; ereg("[0-9]{8}", $string, $regs) ; echo $regs[0];
thanks a lot!