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 */