I am a bit confused here on how I implement an array into JS from PHP....
I\'m doing this for testing - eventually I\'ll use long polling or websockets if they get h
I agree with the answer in your comments. I would make an AJAX call to yourFile.php and then send back your JSON encoded response. so here would be my psuedo code.
1. Make AJAX request
$.ajax({
url: "yourFile.php",
dataType: 'json',
success: function(data)
{
console.log(data);
}
});
2. Make sure that your PHP file also returns header for JSON
header('Content-type: application/json');
2. Return {"x":"283","y":"99","sid":"1"} as data on your ajax request
3. call the values by using data.x or data.y or data.sid