send json in get header php code example Example: php header json header('Content-Type: application/json'); echo json_encode($data);