How to print an error to the console 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!');
?><script>
console.log(<?= json_encode($foo); ?>);
</script>
Also in PHP:
- create custom pagination in laravel 7 for api
- convert json to array php
- expire Cache Manually laravel
- error reporting all php
- 0 == "string" php
- client's ip address in php
- b64decode php
- acheck key exist in array php
- create laravel project in laravel/laravel
- actual url php
- calculate person age by birthdate php
- autoload file in laravel
- change native password in phpmyadmin
- check key exists in associative array in php
- current php date
- Class 'PHPUnit_Framework_TestCase' not found in vendor
- cache laravel example
- count characters php
- display errors on
- day in php time
- SET CURRENT DATE TIME IN PHP'
- base64_decode() output to header location
- alter seeder in laravel
- artisan migrate single class