Skip to content

Latest commit

 

History

History
48 lines (39 loc) · 579 Bytes

array_keys.md

File metadata and controls

48 lines (39 loc) · 579 Bytes

array_keys

array_keys — Return all the keys of an array.

Description

array_keys(mixed $map_or_list) : array

Parameters

map_or_list

  • Initial (map or list).

Return Values

An indexed array containing the array keys.

Examples

Example #1 array_keys()

$list:(
    go,
    stop
);

$result: array_keys($list);

Output:

(
    0: 0,
    1: 1
)


Example #2 array_keys()

$map:(
    colors: (primary: blue, secondary: red)
);

$result: array_get($map, 'colors.primary');

Output:

blue