I am trying to pass AJAX, JSON to PHP, and then PHP is returning some data, and I'm trying to parse it using Javascrpt.
From php server, I'm coming back,
echo json_encode($data);
// it outputs ["123","something","and more something"]
and then on the client side,
success : function(data){
}
But it gives like:
data[0] = [
data[1] = "
data[2] = 1
It reads every character, but I need strings from an array, not individual characters. What's going on here? Thanks in advance, I am new to Javascript and JSON, AJAX.
source
share