I use file_get_contents("http://www.mydomain.com"); to get the content. Then I need to search through it for a word and return the whole line where the word is found. Is this possible?
Asked
Active
Viewed 257 times
1
-
wait, are you trying to parse html? – Andreas Wong Apr 02 '12 at 10:07
-
1What do you mean by "line"? A paragraph? – Obay Apr 02 '12 at 10:07
1 Answers
2
Iterate over each line in content.
Use strpos
to check if line contains word that you are looking for.

Community
- 1
- 1

Jarosław Gomułka
- 4,935
- 18
- 24