I have a php array of key => value, and I would like to store all the values into a list (like a python list) of values. I need it cause I have to pass this list of values to a JQuery script.
Basically I have:
$var = Array ( [0] => 5 [1] => 7 [2] => 9 [3] => 10 )
and I would like to have something like
$var = [5, 7, 9, 10];
When I call from Jquery my variable:
var newvariable = "<?php echo $var ?>";
The final goal is to have a Jquery list like:
var newvariable = [5,7,9,10];
Is this possible in php?
$var = "[5, 7, 9, 10]";