echo console.log
/*
console.log in php
*/
<?php
function consoleLog($message) {
echo '<script type="text/javascript">' .
'console.log(' . $message . ');</script>';
}
consoleLog('Hello, greppers!');
?><?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:
- can i back up mysql database from php code?
- collection empty laravel
- binary base64 decode php
- check if a key is in an array
- error reporting on ini
- Created Migration: laravel
- count rows mysql limit php
- applying multiple order by in codeigniter
- catching error php
- date format php sql
- divided by 3 php
- Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\PPETrackerApp\email.php on line 21
- check string contain symbol in php
- error enable in php
- create directory ph
- create new laravel project 8
- display errors in php
- determine length of stirng php
- adding days to time value in php
- explain email injection
- encryption key has not encrypted laravel
- data type check in php
- apache php default date format 4 digits
- array reverce php