evank3 Posted February 24, 2007 Share Posted February 24, 2007 Ok, so I need a php code that looks in another file for a line of code. So it searches for a certain line of code in another file. also is it possible to read 1,2,3, etc lines after that line that was read? Link to comment https://forums.phpfreaks.com/topic/39969-find-line-of-code/ Share on other sites More sharing options...
magic2goodil Posted February 24, 2007 Share Posted February 24, 2007 look up fopen() for opening the file to be read and fclose() for closing it I would suggest a for loop for counting through the lines and checking each line for a match. Then add 1 to the counter before you add it into your found array to get the correct line number of your matches. Have this continue through the end of the file. Link to comment https://forums.phpfreaks.com/topic/39969-find-line-of-code/#findComment-193267 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.