In php I return this from a function:
return json_encode(array($array1, $array2, $array3, $array4));
Each array contains single elements, loaded lke this:
while ($obj = $DB->next($res)) {
$array1[] = $obj->the_data;
}
Now in JavaScript, I alert data[0], it shows me "["
Of course the entire data looks similar to this:
[["element1", "element2", "element3"],["element1", "element2", "element2" ... etc
Am I loading the array's incorrectly in php? or am I parsing them incorrectly in JavaScript?
- this is being returned in a jQuery Ajax
.postcall. - I also am using this question as a reference