I have php code that open an txt file then click click enter 2 times, then write data
sample

```
1

2

3

```

i just want help to write same data but in first line in txt file
mean php open the txt then go to first line and before the texts, and click enter two times then enter the same data, sample will be

```
3

2

1

```

this is my code

```
<?php

if(isset($_POST['textdata']))
{
    $data=$_POST['textdata'];
    $nice=$_POST['namee'];

    $date = date('m/d/Y h:i:s a', time());
    date_default_timezone_set('Etc/GMT-3');

    $fp = fopen('data.txt', 'a');
    ~ here I want code to select first line in txt file
    fwrite($fp, "\n" );
    fwrite($fp, "\n" );
    fwrite($fp,date('Y-m-d') . ' - ' . date('H:i:s'). "\n"); 
    fwrite($fp, $nice); 

```