Answers for "print data in console with php"

PHP
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
0

php console print

$a = array(
 null => 'a',
 true => 'b',
 false => 'c',
 0 => 'd',
 1 => 'e',
 '' => 'f'
);

echo count($a), "\n";
Posted by: Guest on October-10-2020

Browse Popular Code Answers by Language