I need return json object from php, this is my code:
$resultFromDB = PerformTransaction($requestToDB);
if($resultFromDB['status'] == '0'){
$myReturn = array('status' => '0','message' => 'success');
header('Content-Type: application/json');
$json_result = json_encode($myReturn,JSON_UNESCAPED_UNICODE);
echo trim($json_result,'');
}else{
$myReturn = array(
'status' => $resultFromDB['status'],
'message' => $resultFromDB['errorMsg']
);
header('Content-Type: application/json');
echo json_encode($return,JSON_UNESCAPED_UNICODE);
}
when result status from function = 0, then result this code should be:
{"status":"0","message":"success"}
when sent through Idea IntellIJ Test RESTful webservice, I get the result:

{"status":"0","message":"success"}
how to correctly return the result, that I would not have extra characters