if i have an associative array in php.
Say, in the same view, i have $params array:
$parameters = array(
'parameter1'=>'value1',
'parameter2'=>'value2
);
Is there any way or php function or even javascript function to convert the php array to javascript array? in such a way that if we have the converted array, jsParameters, you'd be able to access it's fields and values like :
console.log(jsParameters.parameter1);
console.log(jsParameters.parameter2);
that will output, 'value1' and 'value2'. Is there a way? many Thanks!