<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>sample20</title>
</head>
<body>
<?php if(!empty($_REQUEST['my_name'])):?>
<p>お名前: <?php echo htmlspecialchars($_REQUEST['my_name']);?></p>
<?php endif; ?>
</body>
</html>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<form action="submit.php" method="post">
<h2>ご予約希望日</h2>
<ul>
<li>
<label>
<input type="checkbox" name="reserve[]" value="1/1" />1月1日
</label>
</li>
<li>
<label>
<input type="checkbox" name="reserve[]" value="1/2" />1月2日
</label>
</li>
<li>
<label>
<input type="checkbox" name="reserve[]" value="1/3" />1月3日
</label>
</li>
</ul>
<input type="submit" value="送信する" />
</form>
</body>
</html>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h2>ご予約日</h2>
<?php if (!empty($_REQUEST['reserve'])):?>
<?php $reserves = $_REQUEST['reserve']; ?>
<ul>
<?php foreach($reserves as $reserve): ?>
<li><?php echo htmlspecialchars($reserve, ENT_QUOTES) ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</body>
</html>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<?php
$age = '12';
$age = mb_convert_kana($age, 'n', 'UTF-8');
if(is_numeric($age)){
echo $age . '歳です。';
}else{
echo '※数字で入力してください';
}
?>
</body>
</html>