PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
1.Read file in array with function File() or you can write your own reading function
2.Check each line with strpost, for that you can use foreach
3. if find word then stop.
This solution is slow, but it depends of file size.
staar2 wrote:1.Read file in array with function File() or you can write your own reading function
2.Check each line with strpost, for that you can use foreach
3. if find word then stop.
This solution is slow, but it depends of file size.
It makes more sense to use file_get_contents() to read the entire contents into a single string