Can anyone tell me how can I get the last result in the first line of a PHP return rather than having the last result in the last line. Here's my code:
<?php
$ip_get = date("Y/m/d") ." ". date("h:i:sa") . " " . getRealIpAddr() . " " .
PHP_EOL ;
$filename1 = 'iplogsget.csv';
file_put_contents($filename1, $ip_get , FILE_APPEND);
?>
At the moment, it outputs something like:
2021/07/22 12:51:58pm XXX.XXX.XXX.XXX
2021/07/22 12:55:58pm XXX.XXX.XXX.XXX
And I would like this kind of output instead:
2021/07/22 12:55:58pm XXX.XXX.XXX.XXX
2021/07/22 12:51:58pm XXX.XXX.XXX.XXX