Answers for "is_array"

PHP
4

php isarray

<?php
$yes = array('this', 'is', 'an array');

echo is_array($yes) ? 'Array' : 'not an Array';
echo "\n";

$no = 'this is a string';

echo is_array($no) ? 'Array' : 'not an Array';
?>
Posted by: Guest on April-12-2020
0

is_array

PHP function is_array(mixed $value) bool
----------------------------------------

Finds whether a variable is an array

Parameters:
mixed--$value--The variable being evaluated.
Returns: true if var is an array, false otherwise.
  
Example:
--------
  

$yes = array('this', 'is', 'an array');

echo is_array($yes) ? 'Array' : 'not an Array';

echo "\n";
output: Array
  
  
$no = 'this is a string';

echo is_array($no) ? 'Array' : 'not an Array';
output: not an Array
Posted by: Guest on September-30-2021

Browse Popular Code Answers by Language