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

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -