Answers for "php write in console?"

PHP
2

console php

//display message in console

<?php
	function console_log($msg) {
		echo '<script>' .
          'console.log("'.$msg .' ")</script>';
	}

	console_log("Hi there!");
?>
Posted by: Guest on October-06-2020
-1

php print to console

<script>
    console.log(<?= json_encode($foo); ?>);
</script>
Posted by: Guest on June-06-2020

Browse Popular Code Answers by Language