php - Change pointer for file_put_contents() -
php - Change pointer for file_put_contents() -
$iplog = "$time est - $userip - $location - $currentpage\n"; file_put_contents("iplog.txt", $iplog, file_append);
i trying write text file, puts @ bottom , prefer if new entries @ top. how alter pointer puts text?
to prepend @ origin of file uncommon, requires info of file copied. if file large, might unacceptable performance (especially when log file, written to). re-think if want that.
the simplest way php this:
$iplog = "$time est - $userip - $location - $currentpage\n"; file_put_contents("iplog.txt", $iplog . file_get_contents('iplog.txt'));
php
Comments
Post a Comment