Вот код PHP:
Код: Выделить всё
......
$jsonData = ['status' => $status,'message' => $message, 'more' => $more];
header('Content-type: application/json');
echo(json_encode($jsonData));
exit();
Код: Выделить всё
function respond ($status, $message, $more=null, $http=null)
{
if ($http !== null) { http_response_code($http); }
$jsonData = ['status' => $status,'message' => $message, 'more' => $more];
header('Content-type: application/json');
echo(json_encode($jsonData));
exit();
Привет, deceze. Ответ браузера:
Ответ браузера
Ответ почтальона:
Ответ почтальона
Спасибо, я решил проблему, заменив
Код: Выделить всё
echo(json_encode($jsonData));Код: Выделить всё
print_r(json_encode($jsonData);с помощью Postman и приложения для простоты я пока использовал http. Спасибо вам всем. (РЕШЕНО)
Подробнее здесь: https://stackoverflow.com/questions/788 ... -it-doesnt
Мобильная версия