Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php array to console

function console_log( $data ){
  echo '<script>';
  echo 'console.log('. json_encode( $data ) .')';
  echo '</script>';
}

Usage:
$myvar = array(1,2,3);
console_log( $myvar ); // [1,2,3]
Comment

php echo an array to console

echo "<script>console.log('" . json_encode($data) . "');</script>";
Comment

PREVIOUS NEXT
Code Example
Php :: explode in laravel blade 
Php :: laravel add item to array 
Php :: search on taxonomy wordpress query 
Php :: php 2d empty array remove 
Php :: laravel token logout 
Php :: a facade root has not been set phpunit 
Php :: laravel websockets onmessage 
Php :: how do decode base64 php 
Php :: how to force delete in laravel 8 
Php :: How do I make a redirect in PHP? 
Php :: Carbon Add Days To Date In Laravel 
Php :: carbon parse timestamp 
Php :: delete_user hook in wordpress 
Php :: osx php 
Php :: php change array into comma delimited string 
Php :: convert xml file to array php 
Php :: password hash php 
Php :: validation not exists with this id laravel 
Php :: how to use php echo data in javascript 
Php :: php days remaining 
Php :: php array merge skip diplicate 
Php :: php line break in echo 
Php :: merge two arrays one as key to another php 
Php :: php convert month number to name 
Php :: how to change date formate in laravel 
Php :: add 1 day php datetime 
Php :: add hour minute in datetime in php 
Php :: laravel wher in 
Php :: php check connection to database 
Php :: join in laravel eloquent 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =