w3coded console array w3coded console array @Kavin. Glad to hear it but this solution w3coded console array is different. Here you can use the json object w3coded console array from javascript. In the accepted solution, the w3coded console array json object is passed to javascript as a w3coded console array string. w3coded console array – JazZ Feb w3coded console array 19 '17 at 8:15 , w3coded console array w3coded console array Stack Overflow for Teams w3coded console array Where developers & technologists share w3coded console array private knowledge with coworkers w3coded console array , w3coded console array What kind of substance that w3coded console array existed in the middles ages could, when ignited, w3coded console array potentially destroy everything within several w3coded console array miles? ,Note: I w3coded console array understand this question is asking about arrays, w3coded console array so string is probably fine, but to represent w3coded console array more complex objects this works better.
Example
echo "<script>console.log('" . json_encode($data) . "');</script>";
Try adding JSON.parse in addition to what the others said - that way it gets console.log
ged as an object, meaning you can expand it and navigate it in Chrome like so.
echo "<script>console.log(JSON.parse('" . json_encode($data) . "'));</script>";
I'm using
echo "<script>console.log(".json_encode(var_export($object, true)).");</script>";
PHP file :
<?php
$data = array(
"data" => "Hello",
"data1" => "World"
);
echo "<script>console.log(".json_encode($data).");</script>";
Last Update : 2023-09-22 UTC 13:26:59 PM
Last Update : 2023-09-22 UTC 13:26:54 PM
Last Update : 2023-09-22 UTC 13:26:42 PM
Last Update : 2023-09-22 UTC 13:26:25 PM
Last Update : 2023-09-22 UTC 13:26:08 PM
Last Update : 2023-09-22 UTC 13:25:36 PM
Last Update : 2023-09-22 UTC 13:25:30 PM