id; if (!$data) { http_response_code(400); } else { $applyoutfit = applyOutfit($user->id, $id); if ($applyoutfit === true) { $applyoutfit = "Outfit Applied"; } header('Content-Type: application/json'); echo json_encode(array("alert" => $applyoutfit)); }