I have a php array "$values", i want to transfer its values to a js array, which is working well, the only problem i'm getting is that it's making the 2 values sended stuck together as "onetwo" while i want them to be as two different values ["one","two"] in my Js array.
<?php
$values= ["one", "two"];
?>
<script>
var Js_array = [];
Js_array.push('<?php
for ($x = 0; $x < count($values); $x++) {
echo $values[$x];
}
?>');
alert(Js_array);
</script>
Thanks for your help.