Hello,
I am using $foo = file($file); to open up a text file. This puts each line into a different element of the array.
So $foo[0] contains line one of the file.
I need a way to search through each line of the array looking for a text value (lets call it $needle) and once that value is found i need to know which element of the array held it. ie: what line of the file it was on.
I looked at most of the array functions but the only ones I could find that seemed helpfull only returned TRUE or FALSE depending on whether the value was present in the array and did not show which element the value was in.
(BTW I do know that the value of $needle is somewhere in the array)
Maybe there is already a function that does this and I overlooked it...if so then apologies for taking up your time.
Thanks in advance,
Kevin