I’m having a problem. What I want to do is make my PHP code do a search until it finds what was entered. For example if I searched the number “12.” I want it to go in a file like the one below and find the line that has “12” in it.
Dark Green = 11 = No = 20,
Light Blue = 12 = No = 20,
Lime Green = 13 = No = 20,
Sensei Gray = 14 = Yes = 0,
In that case this line would have the 12 in it:
Light Blue = 12 = No = 20,
Next what I want the code to do after it finds the line is for it to read the text that is before the “=” sign to the left of it. In this case I would want my code to read:
Light Blue
I’ve always wanted to do this and any help would be HIGHLY appreciated!
Try the code below
In the loop use to check the word to search
Like that
or
(…)
To get the text in the file try use