php wright to console code example Example: php print to console <script> console.log(<?= json_encode($foo); ?>); </script>