10 June 2018
#!/usr/bin/env php -q

echo 'hello world' . PHP_EOL;

// https://stackoverflow.com/questions/2063322/what-does-the-q-php-command-line-option-do
// The -q flag suppresses HTTP header output. As long as your script itself does not send anything to stdout, -q will prevent cron from sending you an email every time the script runs. For example, print and echo send to stdout. Avoid using these functions if you want to prevent cron from sending you email.



$handle = fopen("./test.log", "a");
echo 'ok' . PHP_EOL;

// cat test.log
// ok