Output debug information to file

Snippet

Use file_put_contents to dump debug information to a file.

file_put_contents('/tmp/xxx.txt', print_r($match, TRUE) . "\n", FILE_APPEND);
file_put_contents('/tmp/xxx.txt', "wysiwyg is ${wysiwyg}\n", FILE_APPEND);
 
/* 
tail -f /tmp/xxx.txt # watch the results
*/

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.