Skip to content
Advertisement

PHP, Date() and fopen

I have an error system that take the date() and the error and insert it into a file:

JavaScript

My problem: for start at the fopen at the second parameter I need the pointer to be at the start and that looked at the manual and I need the parameter to be writing only, put the pointer at the start and not truncate the file to zero length, and the only I found is the parameter ‘a’ all is good with ‘a’ except the pointer at the end each time, so if anyone know what parameter can I use, so the pointer at the start and it’s write only and it wont truncate the file to zero length, also I am trying as you see to insert the date and for example: the time here is 18:00 the time was inserted is 15:00.

Advertisement

Answer

You can try this logic

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement