Oihana PHP

isAssociative.php

Table of Contents

Functions

isAssociative()  : bool
Determines if an array is associative.

Functions

isAssociative()

Determines if an array is associative.

isAssociative(array<string|int, mixed> $array) : bool

Usage :

```php
use function core\arrays\isAssociative ;
$array =
[
  'id'          => 1 ,
  'created'     => null ,
  'name'        => 'hello world' ,
  'description' => null
];
echo json_encode( isAssociative( $array ) ) ;
```
Parameters
$array : array<string|int, mixed>

The array to evaluate.

Tags
author

Marc Alcaraz (ekameleon)

since
1.0.0
Return values
bool

Indicates if the array is associative.


        
On this page

Search results