I am working on a cron php script that will run once a day. Since it works this way, output from the file is not possible.
I could literally write all the messages I want into a variable, adding constant information that I want to write to a file, but that would be very tedious and I didn’t have to.
Is there a PHP command to specify a write buffer to write to a log file somewhere? Is there a way to access what has already been sent to the buffer so that I can see the messages that my script is doing.
For example, let's say the script says
PHP:
<?
echo 'hello there';
echo 'hello world';
?>
It should output a message to the file: "hello therehello world";
Any ideas? Is it possible?
I already know
file_put_contents('log.txt', 'some data', FILE_APPEND);
" ", , " ", . , PHP.