id = $id; $this->firstname = $firstname; $this->lastname = $lastname; } } parse_str($_SERVER['QUERY_STRING']); $nogen = new Person($id, 'Anders', 'And'); header('Content-type: application/json'); echo json_encode($nogen); ?>