json encode to array php code example
Example: how to json_encode an array in php unexpected identifier
// Don't wrap the json_encode result in quotes
var data = <?php echo json_encode($serializedData) ?>;
// Don't wrap the json_encode result in quotes
var data = <?php echo json_encode($serializedData) ?>;