console data from php to jquery console
<script>
console.log(<?= json_encode($foo); ?>);
</script><?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:
- cache clear laravel command
- convert a string into uppercase php
- check if string exist in string php
- date du joure n php
- downlad php
- create project laravel 7 ?
- Laravel disable login and register route
- check if an element in array is accesetphp
- not null in laravel
- disadvantages of php
- adding days in date, php
- check if array key exists php
- catch new exception php
- __dir__ in php
- 2.30 will display 2.3 in php
- $this->throwError php
- array reverse order php
- check which device is used to open webpage php
- catch http exceptions php
- enable reporting php
- all words capital php
- codeigniter where order by
- dateformat j/m/a php
- fillable vs guarded laravel