id = $_POST['sessionId']; else trigger_error( missing_parameter_error("sessionId") ); // read other $_POST properties for game session $gameSession->timeToFinish = $_POST['duration']; $gameSession->success = (strcasecmp( ($_POST['success'] ?? false), "true" ) == 0) ? 1 : 0; $gameSession->score = $_POST['score']; // close the game session if ($gameSession->stop()) { $session_arr = $gameSession->getResultArray(true, "Session_Stop_OK"); print_r(json_encode($session_arr)); // OK } else trigger_error("Error_Occured"); ?>