equivalent console.log in php
// 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!');
?><?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;
}
Also in PHP:
- ci db query error
- check value present in string php
- check var type php
- Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in
- check which device is used to open webpage php
- date format functino php
- code php ajout heure
- date fonction php
- Create Laravel Project 7
- create a new laravel 8 project
- case statement in php
- decode base 64 php
- check if string contains a word php
- check if substring in string php
- find a word in srting php
- .lenght en php string
- display php error
- add days in php
- $_Server php find
- check for a key in array + php
- base64 decode in php
- add more data to variable php
- Who is known as the father of PHP?
- extract contact page url php