I am trying to display a PHP array in a JavaScript function.
function displayinfo(id){
var array = [ {{ $infoarrayFromController[id] }} ];
}
Here, as the id is supposed to be received from the select option in the form, and the respective information is supposed to be displayed.
The problem I am facing is that I am not able to pass the variable into the array.