0
1

More than 3 years have passed since last update.

is_arrayについて

Posted at

is_arrayとは

is_array() = ()の中の引数が変数か配列か判定する関数。
変数が配列の場合「true」、配列ではない場合「false」が返される。


$number = array( 1,2,3,4);  //array()で配列を作成

if(is_array($number) ){
  print '$numberは配列です。';  //true時の処理
} else{
  print '$numberは配列ではありません。'; //false時の処理
}

↓ //出力結果

$numberは配列です。

参考元はこちら
(https://www.php.net/manual/ja/function.is-array.php)
(https://php-beginner.com/function/var/is_array.html)

0
1
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
1