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 :: webhook discord php 
Php :: group by laravel 
Php :: yii2 where in 
Php :: Deleting all files inside a directory laravel 8 
Php :: php word wrap 
Php :: add zeros in front of number php 
Php :: laravel generate slug 
Php :: echo first 100 prime numbers php 
Php :: How to change add to cart button in wordpress 
Php :: php reload current page 
Php :: php int min 
Php :: php maxupload 
Php :: wordpress order by 
Php :: doument root phpp 
Php :: php calculate percentage 
Php :: wordpress define constant if not defined 
Php :: get file each line in php 
Php :: call table name in model laravel 
Php :: php add days to date 
Php :: how to create a new component in laravel 
Php :: Print exact sql statement executed 
Php :: laravel pluralization text 
Php :: laravel carbon create date from string 
Php :: laravel upload image to public folder 
Php :: Zend Framework 2 in a ZF1 project 
Php :: how to check php string length 
Php :: php sleep 1 second 
Php :: destroy php variable 
Php :: laravel check old password 
Php :: how to add cutom menu option in wordpress 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =