Skip to content

Kirby 6.0.1

A::isAssociative()

Checks whether an array is associative or not

A::isAssociative(array $array): bool

Parameters

Name Type Default
$arrayrequired array no default value

Return type

bool

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