Here is my PHP array:
$entries = array(
    1420934400 => array(
        'entry' => 'I think I liked it.',
        'data' => 'some'
    ),
    1452470400 => array(
        'entry' => 'Turkey is much better. Tastes more like chicken.',
        'data' => 'no calls'
    ));
Then I convert to JSON
$entries = json_encode($entries);
This produces the string:
{"1420934400":{"entry":"I think I liked it.","data":"some"},"1452470400":{"entry":"Turkey is much better. Tastes more like chicken.","data":"no calls"}}
...which I believe is valid JSON. But when I try to access in JavaScript:
<script>
    var fetchedEntries = JSON.parse(<?php echo $entries ?>);
    console.log('entries: %o', fetchedEntries);
</script>
I get the following error:
SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data
Can anyone see where I'm going wrong?


JSON.parse('<?php echo $entries ?>');