タグ

2020年12月12日のブックマーク (2件)

  • 【PHP入門】switch/caseの基礎から応用まで解説! | 侍エンジニアブログ

    PHPには、条件によってプログラムの処理を分岐するためのswitch文があります。 この記事では、 ・switch文の使い方が知りたい ・swich文で複数条件を指定する方法が知りたい という基的な内容から、 ・switch文で厳密な比較を行う方法が知りたい ・繰り返し処理の中でswitch文を使用したい ・switch文で比較演算子を使用した分岐処理を行いたい ・swich文で処理のスキップや終了する方法が知りたい などの応用的な方法に関しても解説していきます。 今回はそんなswitch文の使い方について、わかりやすく解説します! switch文とは switch文とは、「もし◯◯だったら、△△の処理をする」といった条件ごとに処理を行うための文法です。 if文は主に条件式によって処理を分岐するのに対して、switch文は、ある変数の値によって分岐処理を行うときに主に使用します。 swi

    【PHP入門】switch/caseの基礎から応用まで解説! | 侍エンジニアブログ
    sachiko-kame
    sachiko-kame 2020/12/12
    "switch厳格な比較に"
  • PHP - 型の比較表

    Getting Started Introduction A simple tutorial Language Reference Basic syntax Types Variables Constants Expressions Operators Control Structures Functions Classes and Objects Namespaces Enumerations Errors Exceptions Fibers Generators Attributes References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Predefined Attributes Context options and parameters Su

    sachiko-kame
    sachiko-kame 2020/12/12
    "比較演算し switch 緩やかな比較"