console.log equivalent for php
/*
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:
- base encode64 php
- artisan run seed
- $_Server php
- date format change in laravel blade
- convert string to int php 7
- php switch break
- Database name seems incorrect You're using the default database name laravel. This database does not exist. Edit the .env file and use the correct database name in the DB_DATABASE key.
- detect duplicate in array php
- creating new laravel project using composer
- clearn route cacje laravel
- Add “Affected Products” in catalog price rule
- check if astring is apart of another string in php
- ensure a header is included with request laravel
- Pacific Daylight Time Zone php
- date increase 1 day
- automatically refresh a php code
- delay in php
- error reporting on in php
- clear cache controller laravel
- description seed database laravel
- array key exists function in php
- check backend post type
- cronjob cakephp
- find str in str php