setPassword($_SESSION['uid'], $_POST['oldpwd'], $_POST['pwd']); if($result['success']) $statusCode = 201; else $statusCode = 400; } http_response_code($statusCode); header('Content-Type: application/json'); echo json_encode($result, JSON_UNESCAPED_UNICODE);