i need to save text at top of txt file , which will automatic makes 1st line text to be second line, 2nd line text to be 3rd line... so on.
For example, there is abc.txt file contains text in 1st line = hello
i need to write 1st line = "first"
and then 1st line which was "hello" , it must come to second line automatic.
what changes i need to do in the code below?
$my_file = "help";
$handle = fopen($my_file, 'a');
$ggg = "first";