Guest burner Posted June 18, 2009 Share Posted June 18, 2009 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 More sharing options...
Ingolme Posted June 18, 2009 Share Posted June 18, 2009 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 More sharing options...
NurAzije Posted July 6, 2009 Share Posted July 6, 2009 you can also use file() functions which will return an array, and you search the array and get back the element number as the line number. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.