$id = $statuses['status']; } switch($overall) { case "online": $jsonObj->overall = "Online"; break; case "maintenance": $jsonObj->overall = "Maintenance"; break; case "offline": $jsonObj->overall = "Offline"; break; default: $jsonObj->overall = "Online"; break; } $json = json_encode($jsonObj); echo $json; ?>