<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sample01</title>
</head>
<body>
<?php
for($i = 0; $i < 366; $i++):
$time = strtotime("+$i day");
// strtotime('+'.$i.'day');でもOK
$day = date('n/j(D)', $time);
echo $day . '<br>';
endfor
?>
</body>
</html>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sample01</title>
</head>
<body>
<?php
$week_name = ['日', '月', '火', '水', '木', '金', '土'];
date_default_timezone_set('Asia/Tokyo');
$week = date('w');
echo $week_name[$week];
?>
</body>
</html>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sample01</title>
</head>
<body>
<?php
$fruitu = [
'apple' =>'りんご',
'grape'=>'ぶどう',
'lemon'=>'レモン',
'tomato'=> 'トマト',
'peach'=> 'もも'];
?>
<dl>
<?php foreach ($fruitu as $english => $japanese): ?>
<dt><?php echo $english; ?></dt>
<dd><?php echo $japanese; ?></dd>
<?php endforeach ?>
</body>
</html>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sample01</title>
</head>
<body>
<?php
$s = 'あいうえお';
if($s):
echo '$sには文字が入っています。';
endif;
$x = 0;
if(!$x):
echo '0. 0ではない';
endif;
$x = 10;
if(!$x):
echo '1. 0ではない';
endif;
?>
</body>
</html>