« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 10 of about 371 for else (0.004 sec.)
else | PHP 8.3 13863
else (PHP 4, PHP 5, PHP 7, PHP 8) ある条件が満たされている場合にある文を実行し、 その条件が満たされていない場合に別の文を実行したいと考えた ことが度々あるかと思います。 このために else があります。 else は、 if 文における式の値が false の場 ... うでない場合に、 aはbよりも大きくない と表示します。 <?php $a = 3 ; $b = 5 ; if ( $a > $b ) { echo "aはbよりも大きい\n" ; } else { echo "aはbよりも大きくない\n" ; } 上の例の出力は以下となります。 aはbよりも大きくない else 文は、 if 式が false と評価さ ... れた場合のみ実行されます。 また、 elseif 式がある場合には、それも false と評価された場合にのみ実行されます。 ( elseif 参照) 注意 : else がぶら下がる場合 if - els ... e 文がネストした場合、 else は常に、もっとも近い if 文に関連付けられます。 <?php $a = false ; $b = true ; if ( $a ) if ( $b ) echo "b" ; else echo "c" ...
https://man.mtool.work/php/8.3/control-structures.else.html
elseif/else if | PHP 8.3 12376
elseif/else if (PHP 4, PHP 5, PHP 7, PHP 8) elseif は、その名前から分かるように、 if と else の組み合わせです。 elseif は、 else のように、元の if 式の値が false の場合に別の文を実行するように if 文を拡張します。 しかし、 else とは異なり、 ... aはbと等しい 、 aはbより小さい のいずれかを出力します。 <?php $a = 1 ; $b = 1 ; if ( $a > $b ) { echo "aはbより大きい" ; } elseif ( $a == $b ) { echo "aはbと等しい" ; } else { echo "aはbより小さい" ; } 上の例の出力は以下となります。 aはbと等しい 複数 ... の elseif を同じ if 文の中で使用することができます。 true と評価された最初の elseif 式を実行します。PHP では、(単語二つで)'else if ... 'と書くこともできます。 動作は(一単語の) 'elseif'と同じです。文法的な意味はやや異なっています (あなたが C 言語に詳しいとすると、C 言語のそれと同じ動作です)。 しかし、最終 ...
https://man.mtool.work/php/8.3/control-structures.elseif.html
print — 文字列を出力する | PHP 8.3 7570
print (PHP 4, PHP 5, PHP 7, PHP 8) print — 文字列を出力する 説明 function print ( string $expression ): int expression を出力します。 print は実際には関数ではなく、 言語構造です。 引数は、 print の後に文字列として評価される式を指定し、括弧で ... す。 // print 文は、式の評価結果全体をひとつの引数とみなします。 if ( print( "hello" ) && false ) { print " - inside if" ; } else { print " - inside else" ; } // " - inside if" を出力します。 // ("hello") && false という式が最初に評価され、 // 評価され ... は、キーワードと引数を括弧で囲む必要があるかもしれません: <?php if ( (print "hello" ) && false ) { print " - inside if" ; } else { print " - inside else" ; } // "hello - inside else" を出力します。 // 直前の例と異なり、(print "hello") が最初に評価され ... 、 // "hello" を出力した後、print が1を返します。 // 1 && false は false なので、else ブロックの中身が実行されます。 print "hello " && print "world" ; // "world1"; を出力します。print "world" が先に評価され、 ...
https://man.mtool.work/php/8.3/function.print.html
is_subclass_of — あるオブジェクトが指定したクラスのサブクラスに属するか (あるい... 7226
is_subclass_of (PHP 4, PHP 5, PHP 7, PHP 8) is_subclass_of — あるオブジェクトが指定したクラスのサブクラスに属するか (あるいは指定したインターフェイスを実装しているか) どうかを調べる 説明 function is_subclass_of ( mixed $object_or_class , st ... Factory_Child (); if ( is_subclass_of ( $WFC , 'WidgetFactory' )) { echo "yes, \$WFC is a subclass of WidgetFactory\n" ; } else { echo "no, \$WFC is not a subclass of WidgetFactory\n" ; } if ( is_subclass_of ( $WF , 'WidgetFactory' )) { echo "yes, \$ ... WF is a subclass of WidgetFactory\n" ; } else { echo "no, \$WF is not a subclass of WidgetFactory\n" ; } if ( is_subclass_of ( 'WidgetFactory_Child' , 'WidgetFactory' ) ... ) { echo "yes, WidgetFactory_Child is a subclass of WidgetFactory\n" ; } else { echo "no, WidgetFactory_Child is not a subclass of WidgetFactory\n" ; } ?> 上の例の出力は以下となります。 yes, $WFC is a ...
https://man.mtool.work/php/8.3/function.is-subclass-of.html
制御構造 | PHP 8.3 6997
制御構造 目次 はじめに if else elseif/else if 制御構造に関する別の構文 while do-while for foreach break continue switch match declare return require include require_once include_once goto throw try...catch finally 他のマニュアルの関連ページ ...
https://man.mtool.work/php/8.3/language.control-structures.html
clamp — Return the given value if in range, else return the nearest bound | PHP... 6654
clamp (PHP 8 >= 8.6.0) clamp — Return the given value if in range, else return the nearest bound 説明 function clamp ( mixed $value , mixed $min , mixed $max ): mixed Return the given value if in range of min and max . Else if it's lower th ... an min , return min . Else return max . 注意 : Values of different types will be compared using the standard comparison rules . For instance, a non-n ...
https://man.mtool.work/php/8.3/function.clamp.html
imap_createmailbox — 新しいメールボックスを作る | PHP 8.3 6540
imap_createmailbox (PHP 4, PHP 5, PHP 7, PHP 8) imap_createmailbox — 新しいメールボックスを作る 説明 function imap_createmailbox ( IMAP\Connection $imap , string $mailbox ): bool imap_createmailbox() は mailbox で指定された新しいメールボック ... .example.org}INBOX. $name2 " )) { echo "renamed new mailbox from ' $name1 ' to ' $name2 '<br />\n" ; $newname = $name2 ; } else { echo "imap_renamemailbox on new mailbox failed: " . imap_last_error () . "<br />\n" ; } } else { echo "imap_status on ne ... ailbox ( $mbox , "{imap.example.org}INBOX. $newname " )) { echo "new mailbox removed to restore initial state<br />\n" ; } else { echo "imap_deletemailbox on new mailbox failed: " . implode ( "<br />\n" , imap_errors ()) . "<br />\n" ; } } else { ech ...
https://man.mtool.work/php/8.3/function.imap-createmailbox.html
IntlDateFormatter::isLenient — IntlDateFormatter で使用する寛大さを取得する | P... 6540
IntlDateFormatter::isLenient datefmt_is_lenient (PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL intl >= 1.0.0) IntlDateFormatter::isLenient -- datefmt_is_lenient — IntlDateFormatter で使用する寛大さを取得する 説明 オブジェクト指向型 public function Int ... matter :: GREGORIAN , 'dd/mm/yyyy' ); echo 'lenient of the formatter is : ' ; if ( $fmt -> isLenient ()) { echo 'TRUE' ; } else { echo 'FALSE' ; } datefmt_parse ( $fmt , '35/13/1971' ); echo "\n Trying to do parse('35/13/1971').\nResult is : " . date ... fmt_set_lenient ( $fmt , false ); echo 'Now lenient of the formatter is : ' ; if ( $fmt -> isLenient ()) { echo 'TRUE' ; } else { echo 'FALSE' ; } datefmt_parse ( $fmt , '35/13/1971' ); echo "\n Trying to do parse('35/13/1971').Result is : " . datefm ... matter :: GREGORIAN , "dd/mm/yyyy" ); echo "lenient of the formatter is : " ; if ( $fmt -> isLenient ()) { echo 'TRUE' ; } else { echo 'FALSE' ; } $fmt -> parse ( '35/13/1971' ); echo "\n Trying to do parse('35/13/1971').\nResult is : " . $fmt -> par ...
https://man.mtool.work/php/8.3/intldateformatter.islenient.html
IntlDateFormatter::setLenient — パーサーの寛大さを設定する | PHP 8.3 6425
IntlDateFormatter::setLenient datefmt_set_lenient (PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL intl >= 1.0.0) IntlDateFormatter::setLenient -- datefmt_set_lenient — パーサーの寛大さを設定する 説明 オブジェクト指向型 public function IntlDateFormatter ... matter :: GREGORIAN , 'dd/MM/yyyy' ); echo 'lenient of the formatter is : ' ; if ( $fmt -> isLenient ()) { echo 'TRUE' ; } else { echo 'FALSE' ; } datefmt_parse ( $fmt , '35/13/1971' ); echo "\n Trying to do parse('35/13/1971').\nResult is : " . date ... t_set_lenient ( $fmt , false ); echo "\nNow lenient of the formatter is : " ; if ( $fmt -> isLenient ()) { echo 'TRUE' ; } else { echo 'FALSE' ; } datefmt_parse ( $fmt , '35/13/1971' ); echo "\nTrying to do parse('35/13/1971').\nResult is : " . datef ... matter :: GREGORIAN , 'dd/MM/yyyy' ); echo 'lenient of the formatter is : ' ; if ( $fmt -> isLenient ()) { echo 'TRUE' ; } else { echo 'FALSE' ; } $fmt -> parse ( '35/13/1971' ); echo "\n Trying to do parse('35/13/1971').\nResult is : " . $fmt -> par ...
https://man.mtool.work/php/8.3/intldateformatter.setlenient.html
Collator::compare — ふたつの Unicode 文字列を比較する | PHP 8.3 6196
Collator::compare collator_compare (PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL intl >= 1.0.0) Collator::compare -- collator_compare — ふたつの Unicode 文字列を比較する 説明 オブジェクト指向型 public function Collator::compare ( string $string1 , st ... US' ); $res = collator_compare ( $coll , $s1 , $s2 ); if ( $res === false ) { echo collator_get_error_message ( $coll ); } else if( $res > 0 ) { echo "s1 is greater than s2\n" ; } else if( $res < 0 ) { echo "s1 is less than s2\n" ; } else { echo "s1 ...
https://man.mtool.work/php/8.3/collator.compare.html
PREV 1 2 3 4 5 6 7 8 9 10 NEXT