I would like to know how can I add text at the begining of a specific line in a txt file using PHP.
For example line 2 and 4:
Line 1
Line 2
Line 3
Line 4
to
Line 1
Whatever Line 2
Line 3
Whatever Line 4
Edit: The content of each line is variable all time, so I can't use replace or search for a specific word.
Thank you :)