Answers for "how to use functions in console in php"

PHP
12

php console log

// Assuming you are wishing to log to the JS Console...

<?php
	function consoleLog($msg) {
		echo '<script type="text/javascript">' .
          'console.log(' . $msg . ');</script>';
	}

	consoleLog('Hello, console!');
?>
Posted by: Guest on March-07-2020
1

console log in php

<?php 
function console_log($object){
    echo "<script>console.log(".json_encode(var_export($object, true)).");</script>";
}
console_log('wow!');

?>
Posted by: Guest on September-30-2021

Code answers related to "how to use functions in console in php"

Browse Popular Code Answers by Language