0
0

More than 1 year has passed since last update.

PHP 真偽値の判定 個人メモ

Posted at

目的

  • PHPにおける真偽値の判定方法をメモ的にまとめる

真偽値の判定アレコレ

  • そのままif文の判定箇所に入れる。

    <?php
    $bool = true;
    
    if ($bool) {
        echo 'trueです';
    }
    
  • if文の判定箇所でtrueもしくはfalse===で比較する。

    <?php
    $bool = true;
    
    if ($bool === true) {
        echo 'trueです';
    }
    
0
0
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
0
0