Jump to content

Find String Line


Guest burner
 Share

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...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...