Skip to content

Kirby 5.6.3

A::isAssociative()

Checks whether an array is associative or not

A::isAssociative(array $array): bool

Parameters

Name Type Default Description
$arrayrequired array no default value The array to analyze

Return type

bool

true: The array is associative false: It's not

Parent class

Kirby\Toolkit\A

Examples

$array = ['a', 'b', 'c'];

A::isAssociative($array);
// returns: false

$array = ['a' => 'a', 'b' => 'b', 'c' => 'c'];

A::isAssociative($array);
// returns: true