I have a php method that should return some values as JSON :
function pass_value() {
....
$output[] = 'some value';
...
if() {
//JS get it right
echo json_encode(array('response' => $output));
return;
}
...
//eventually another echo
}
Where's the problem to do it like this ?
function pass_value() {
....
$output[] = 'some value';
...
//js doesn't get it ?
return json_encode(array('response' => $output));
}
I want to terminate the other part of the method after it passes the array, but seems that JS doesn't get the JSON when it's not echoed.