list an array on console php code example Example: php echo an array to console echo "<script>console.log('" . json_encode($data) . "');</script>";