English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
is_array() The function is used to check if a variable is an array.
PHP version requirement: PHP 4, PHP 5, PHP 7
bool is_array ( mixed $var )
Parameter description:
$var: The variable to be checked.
If the detected variable is an array, it returns TRUE, otherwise it returns FALSE.
<?php $arr_site = array('Google', 'w3codebox', 'Facebook'); if(is_array($arr_site)){ echo 'The variable $arr_site is an array'; } else { echo 'The variable $arr_site is not an array'; } ?>
The output result is:
The variable $arr_site is an array