Core Function isVarArray
From Sputnik Wiki
isVarArray( $variable )
Contents |
Description
Checks if a variable is an array type.
Parameters
variable
The variable to check.
Return Value
Success: Returns true.
Failure: Returns false.
Remarks
Can be useful to validate array/non-array parameters to user-defined functions.
Example
$var1 = array(1, 2, 3, 4); $var2 = "Hello"; println( "Var1: " . isVarArray($var1) ); // Alternative println( "Var1: " . ($var1 is array) ); // Alternative println( "Var1: " . ($var1 ~~ array) ); println( "Var2: " . isVarArray($var2) ); // Alternative println( "Var2: " . ($var2 is array) ); // Alternative println( "Var2: " . ($var2 ~~ array) );