Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php console log var_dump

// will log to console once on original page load (php)
// console log simple message from php:
echo "<script>console.log('string to log');</script>";
// console log variable
echo "<script>console.log('"$variableToLog"');</script>";
// console log array (var_dump equivalent)
echo "<script>console.log(`" . json_encode($data) . "`);</script>";
 
PREVIOUS NEXT
Tagged: #php #console #log
ADD COMMENT
Topic
Name
5+4 =