php console log
// A little correction / improvement to @Kaotik's answer:
<?php
function consoleLog($msg)
{
echo '<script type="text/javascript">console.log('
. str_replace('<', '\\x3C', json_encode($msg))
. ');</script>';
}
consoleLog('Hello, console!');
?>