keys()

The keys() method return all the keys of an array

Example.php
<?php use kim\present\utils\arrays\ArrayUtils;

$arrayUtils = ArrayUtils::from(["first" => 1, "second" => 2, "third" => 3]);

//Get all keys
$arrayUtils->keys();
// expected output: ["first", "second", "third"]

Syntax

$arrayUtils->keys() : ArrayUtils;

Return value

  • A array of all the keys in array.

Prefixing

$arrayUtils->keysAs() : array;
ArrayUtils::keysFrom(iterable $from) : ArrayUtils;
ArrayUtils::keysFrom(iterable $from) : array;

References

Last updated