console.log from functions php
<?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;
}<script>
console.log(<?= json_encode($foo); ?>);
</script>
Also in PHP:
- clear cahce config laravel in cpanel
- array_reverse in php
- Word Not Found!strpos(): needle is not a string or an integer on line 6
- add one day to date in php
- check type of var in php
- .htaccess to remove index page
- convert base64 to image php
- clear cache laravel on server
- catch multiple exception php
- composite unique between two columns laravel migration
- check php version
- create new laravel project 8
- check var type php
- download file zip from subdirectory using php
- check characters php
- executar comando linux php
- To add a new Top-level menu to WordPress Administration, use the add_menu_page() function.
- display all php erros
- check if substring php
- associative array rev in php
- convert to format date php
- @if(Auth::user()->id(1))
- check if character in string php
- Allowed memory size of 33554432 bytes exhausted (tried to allocate 5287496 bytes) on laravel