Arr::isAssoc

Posted on November 16, 2016

Determines if an array is associative. An array is "associative" if it doesn’t have sequential numerical keys beginning with zero.

Example usage

$assoc = Arr::isAssoc(['key' => 'value']);

$notassoc = Arr::isAssoc([1,2,3]);

// true
// false

Parameters

array $array

Return Value

bool

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *