console log in web 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!');
?>// A little correction / improvement to @Kaotik's answer:
<?php
function consoleLog($msg)
{
echo '<script type="text/javascript">console.log('
. str_replace('<', '\\x3C', json_encode($msg))
. ');</script>';
}
consoleLog('Hello, console!');
?>
Also in PHP:
- create new laravel project with specific version
- borrar cache laravel
- composer check current php version
- Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file:
- convert php time()
- automatic read .php url website
- Make database seeder run once laravel tests
- clear array php
- enfold remove debugging info for theme support
- codeigniter hget last insert
- Redirect::route('profile') and with() in laravel
- date time format in php
- PHp and adys to date
- Web servers supported by php
- Allowed memory size of 2147483648 bytes exhausted (tried to allocate 4096 bytes) in phar://C:/composer/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52
- acf show the taxonomy image
- check all page names with tempalte
- delete composer for laravel
- check if $_GET key existes in php
- a lot of names strtoupper
- How to check duplicate data in PHP
- add days to current date php
- cappitalize string in php
- Object of class Illuminate\\Database\\Eloquent\\Builder could not be converted to string