LoginSignup
2
2

More than 5 years have passed since last update.

PHPで値が入っていたとき、いないときの条件分岐文の書き方

Last updated at Posted at 2015-01-19

値が入っていれば実行、入っていなければ(null)その他の処理を実行

ex: $Contactに値があるときとないときの分岐文



if ($Contact) {
  <!-値が入っている時の処理 -->
 echo 'お問合せがあります';
} else {
  <!--値が入っていないとき(null)の処理 -->
}
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2