- First, you want to see ajaxReturn prototype:
protected function ajaxReturn ($data, $type='', $json_option=0){
........
switch(strtoupper($type)){
case: 'json':
header('Content-Type: application/json; charset=utf-8');
exit(json_encode($data, $json_option);
break;
}
}
So, ajaxReturn using exit ( '...', $ json_option ) will in itself, it has the output string contents of json encoded. Behind this unnecessary echo the
- Secondly, the use of ajaxReturn, scripts have exit, then you echo what then, have been ineffective!