I want to combine the following arrays:
<?php
$data_a = '{"a":4,"b":5,"c":6},{"a":7,"b":8,"c":9},{"a":10,"b":11,"c":12}';
?>
<script>
array1 = [<?=$data_a?>];
var data_b = '{"a":1,"b":2,"c":3}';
array2 = JSON.parse(data_b);
</script>
I've tried and not succeeded to combine them as following:
combined = array2.concat(array1);
I want the combined array to return
[{"a":1,"b":2,"c":3},{"a":4,"b":5,"c":6},{"a":7,"b":8,"c":9},{"a":10,"b":11,"c":12}]
Anyone's help will be much appreciated!