PHP is_array Function

What is is_array() in PHP?

Explanation

is_array function checks whether the given input value is an array or not.

Syntax:


is_array(variable)

Example :


<?php
$val = array("Hiox","Hscripts");
if(is_array($val))
{
echo "This is an Array";
}
else
{
echo "This is not an Array";
}
?>

Result :

This is an Array

Check if a variable is an array using PHP is_array function.

PHP Topics


Ask Questions

Ask Question