Files
2026-10-09 12:33:29 +09:00

32 lines
892 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/*
* 以下の仕様に沿ってプログラムを完成させてください
*
* ●前の画面で入力された値を受け取ります
* ●0:日曜~6:土曜を、それぞれ入力された数字から判断して出力します
* ●0~6以外の場合は、「0~6の整数を入力してください」と出力します
*
* ※ プログラムは何行書いても良いです
*/
$inputVal = ($_POST['weekNumber']);
// 数値に対応した曜日の出力
if ($inputVal == 0) {
echo '日曜';
} else if ($inputVal == 1) {
echo '月曜';
} else if ($inputVal == 2) {
echo '火曜';
} else if ($inputVal == 3) {
echo '水曜';
} else if ($inputVal == 4) {
echo '木曜';
} else if ($inputVal == 5) {
echo '金曜';
} else if ($inputVal == 6) {
echo '土曜';
} else {
echo '0~6の整数を入力してください';
}