function console_print($obj) { $js = json_encode($obj); print_r('<script>console.log('.$js.')</script>'); } function prettyPrint($a, $t='pre') {echo "<$t>".print_r($a,1)."</$t>";} // https://github.com/kint-php/kint consider using this
Hacks, tips, tricks and best practices for developers
function console_print($obj) { $js = json_encode($obj); print_r('<script>console.log('.$js.')</script>'); } function prettyPrint($a, $t='pre') {echo "<$t>".print_r($a,1)."</$t>";} // https://github.com/kint-php/kint consider using this