Home > Backend Development > PHP Tutorial > PHP is_array() implementation method to detect whether a variable is an array, is_array array_PHP tutorial

PHP is_array() implementation method to detect whether a variable is an array, is_array array_PHP tutorial

WBOY
Release: 2016-07-12 08:49:39
Original
982 people have browsed it

PHP is_array() implementation method to detect whether a variable is an array, is_array array

is_array()

PHP is_array() function is used to detect whether a variable is an array. This function is especially used for some security checks (such as form or SESSION checks, etc.).

Grammar:

bool is_array (mixed var) Returns TRUE if var is an array, otherwise returns FALSE.

Example:

<&#63;php
$arr_age = array(18, 20, 25);
if(is_array($arr_age)){
  echo '变量 $arr_age 是一个数组';
} else {
  echo '变量 $arr_age 不是一个数组';
}
&#63;>
Copy after login

Run this example output:

The variable $arr_age is an array

The above implementation method of PHP is_array() to detect whether a variable is an array is all the content shared by the editor. I hope it can give you a reference, and I also hope that everyone will support Bangkejia.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1136650.htmlTechArticlePHP is_array() implementation method to detect whether a variable is an array, is_array array is_array() PHP is_array() function For detecting whether a variable is an array, this function is especially useful for some security...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template