finally a tuto that seems ok

This commit is contained in:
lenovo
2022-10-26 19:55:16 +02:00
parent c9e794b4ec
commit 40963ce3cb
7 changed files with 52 additions and 28 deletions

View File

@@ -0,0 +1,13 @@
<?php
// https://stackify.com/how-to-log-to-console-in-php/
function console_log($output, $with_script_tags = true) {
$js_code = 'console.log(' . json_encode($output, JSON_HEX_TAG) .
');';
if ($with_script_tags) {
$js_code = '<script>' . $js_code . '</script>';
}
echo $js_code;
}
?>