console.log function 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:
- creating a folder from php and make it writeable for all
- date_default_timezone_set("America/New_York"); echo "The time is " . date("h:i:sa");
- borrar cache laravel
- date( w ) php
- $data=['user_id'] = Auth::user()->id;
- Chace Clear of Larvel
- contact ip address using php
- HTML form, add the data into it and submit it to the database by connecting it to MySQL database using PHP.
- codeigniter db insert return id
- find index of occurrence php
- Failed at the dev script npm run dev
- day date attributes php
- echo date in php
- auto generate 6 string
- artisan create seeder
- 1071 Specified key was too long; max key length
- check length of a string in php
- check image is available on server php
- aptitude install php7.4
- creayte date in ph
- a non well formed numeric value encountered
- create project via composer
- array unique multidimensional array php
- clear cache new command in laravel