PHP | Ds\Map keys() Function Last Updated : 20 Aug, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The Ds\Map::keys() function of PHP is used to get a set of keys of the current Map instance. The order of keys in the returned set is the same as that of the order of keys in the actual Map instance. Syntax: Ds\Set public Ds\Map::keys ( void ) Parameter: This function does not accepts any parameter. Return value: It returns a set of Ds\Set containing all of the keys of the specified Map instance in the same order. Below programs illustrate the Ds\Map::keys() function in PHP: Program 1: php <?php // PHP program to illustrate keys() function $map = new \Ds\Map([1 => "Geeks", 2 => "for", 3 => "Geeks"]); print_r($map->keys()); ?> Output: Ds\Set Object ( [0] => 1 [1] => 2 [2] => 3 ) Program 2: php <?php // PHP program to illustrate keys() function $map = new \Ds\Map(["first" => "Geeks", "second" => "for", "third" => "Geeks"]); print_r($map->keys()); ?> Output: Ds\Set Object ( [0] => first [1] => second [2] => third ) Reference: http://php.net/manual/en/ds-map.keys.php\ Comment More infoAdvertise with us Next Article PHP | Ds\Map keys() Function G gopaldave Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-ds_map Similar Reads PHP key() Function The key() function is an inbuilt function in PHP which is used to return the index of the element of a given array to which the internal pointer is currently pointing. The current element may be starting or next element which depends on the cursor position. By default cursor position is at zero inde 2 min read PHP | DsDeque map() Function The Ds\Deque::map() function is an inbuilt function in PHP which is used to return the Deque with each element modified on the basis of operation performed as per the callback function. Syntax: public Ds\Deque::map( $callback ) : Ds\Deque Parameters: This function accepts single parameter $callback 2 min read PHP | DsVector map() Function The Ds\Vector::map() function is an inbuilt function in PHP which is used to return the result of a callback after applying to each value in the vector. Syntax: Ds\Vector public Ds\Vector::map( $callback ) Parameters: This function accepts single parameter $callback which is to be applied to each ve 2 min read PHP array_keys() Function The array_keys() is a built-in function in PHP and is used to return either all the keys of and array or the subset of the keys. Syntax: array array_keys($input_array, $search_value, $strict) Parameters: The function takes three parameters out of which one is mandatory and other two are optional. $i 2 min read PHP key_âexists() Function The key_exists() function is an inbuilt function in PHP that is used to check whether the given key exist in the given array or not. If given key exist in the array then it returns true otherwise returns false. This function is an alias of array_key_exists() function. Syntax: bool key_exists(string| 2 min read Like