Push PHP Variable to Javascript Array -
i want push php variable javascript. code below not seem work. can show me how this?
ticks.push(<?php echo json_encode($new); ?>);
is you're looking for?
ticks.push(json.parse('<?= json_encode($new); ?>'));
or broken down:
var json = '<?= json_encode($new); ?>'; var obj = json.parse(json); ticks.push(obj)
also addressed in issue:
Comments
Post a Comment