Set content type to JSON header('Content-Type: application/json'); echo json_encode([]); header - will send header to the client application/json - set JSON content type json_encode([]) - output some JSON group: content_types