Jump to content

Find String Line


Guest burner

Recommended Posts

Guest burner

hello im was wondering is it possible to find a string in an external webpage and then find the line number of it.Example :find the word "Explore" in the webpage google.com and then find the line number of that string.Any Help Much Appreciated.

Link to comment
Share on other sites

Once you've loaded the file with file_get_contents() you just use strpos to find the string and then count how many \n characters there are before it (and add one to that so that there's no line 0) to get the line number.

Link to comment
Share on other sites

  • 3 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...