if文04
if文を省略記述する
<?php // 論理型(boolean)の条件判断 $under_construction = TRUE; if ($under_construction == TRUE) { print '<p>工事中です</p>' . "\n"; } if ($under_construction) { print '<p>工事中です</p>' . "\n"; } // FALSEかどうかの判断 $result = FALSE; if (!$result) { print '<p>FALSEです</p>' . "\n"; } // if〜elseの記述 $number = 100; $result = ($number >= 80) ? '合格' : '不合格'; print '<p>結果:' .$result. '</p>' . "\n"; ?>