I tested the following:
<? echo json_encode($array) ?> outputs: ["PG","Kevin Sad","8000","12"]
When I place it inside a form option value to be chosen by my script function:
<option value=<? echo json_encode($array) ?> > option1 </option>
When I click SUBMIT button and the following function fires from the script:
function submit_button(){
var data= player1.options[player1.selectedIndex].value;
document.getElementById('print_result').innerHTML = data;
}
only the following is outputted inside the div id="print_result" :
["PG","Kevin
Something happens with the space character " " that I cannot figure out..
I expected whole array to show up specifically including missing portion:
Sad","8000","12"]