if (!isExist($_SESSION['user_age'])) {
     $errors[] = '年齢を入力してください';
 } else {
     if (!isOverText($_SESSION['user_age'], 3) || !isOnlyNumber($_SESSION['user_age'])) {
         $errors[] = '正しい年齢を入力してください';
     }
 }
 $_SESSION['user_gender'] = entity_str(getPost('user_gender'));
 if (!isExist($_SESSION['user_gender'])) {
     $errors[] = '性別を選択してください';
 }
 $_SESSION['user_profile'] = entity_str(getPost('user_profile'));
 if (!isExist($_SESSION['user_profile'])) {
     $errors[] = 'プロフィールを入力してください';
 } else {
     if (!isOverText($_SESSION['user_profile'], 200)) {
         $errors[] = '文字数は200文字以内にしてください';
     }
 }
 // 画像アップロード処理
 if (!checkPostMaxSize()) {
     $errors[] = 'ファイルサイズは100KB以下にしてください';
 }
 if (isset($_FILES['user_profile_photo'])) {
     for ($i = 0; $i < count($_FILES['user_profile_photo']['name']); $i++) {
         // アップロードファイルチェック
         list($result, $ext, $error_msg) = checkFile($i);
         $errors = array_merge($errors, $error_msg);
         if ($result) {
             $name = $_FILES['user_profile_photo']['name'][$i];
             $tmp_name = $_FILES['user_profile_photo']['tmp_name'][$i];
    }
}
if (isPost()) {
    // ユーザプロフィール編集
    if (getPost('action_id') === 'profile_edit') {
        $my_profile = $main->getMyProfile($db, $login_id);
        $my_time_line = $main->getMyTimeLine($db, $login_id);
        include_once '../include/view/my_profile_edit.php';
    } else {
        if (getPost('action_id') === 'profile_edit_complete') {
            // todo: プロフィール更新処理
            $edit_user_name = entity_str(getPost('edit_user_name'));
            if (!isExist($edit_user_name)) {
                $errors[] = 'ユーザネームを入力してください';
            } else {
                if (!isOverText($edit_user_name, 20)) {
                    $errors[] = '文字数は20文字以内で入力してください';
                }
            }
            $edit_user_profile = entity_str(getPost('edit_user_profile'));
            if (!isExist($edit_user_profile)) {
                $errors[] = 'プロフィールを入力してください';
            } else {
                if (!isOvertext($edit_user_profile, 200)) {
                    $errors[] = '文字数は200文字以内にしてください';
                }
            }
            if (isset($_FILES['edit_user_profile_photo'])) {
                // todo: 画像アップロード入力チェック
                if (!checkPostMaxSize()) {
                    $errors[] = 'ファイルサイズは100KB以下にしてください';