is_array
Checks whether a variable is an array.
Parameters
main.php
Return Values
bool
Returns whether the given variable is an array
On success:true if value is an array
On failure:false if value is not an array
Notes
- Returns true for both indexed and associative arrays
- Returns false for objects, even if they implement ArrayAccess
- Use for type checking before array operations to prevent errors
- Part of PHP's variable handling functions
Changelog
- Function has been available since PHP 4.0.0
Related Functions
isset
VariableDetermines if a variable is declared and is different than null.
checkvalidationsafety
strlen
StringReturns the length of a string in bytes.
lengthvalidationsecurity
empty
VariableDetermines whether a variable is empty. A variable is considered empty if it does not exist or if its value equals false.
validationcheckinput
preg_match
RegExPerforms a regular expression match against a string and returns whether a match was found.
regexpatternvalidation