// 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>";