PHP | Ds\Map values() Function Last Updated : 21 Aug, 2019 Comments Improve Suggest changes Like Article Like Report The Ds\Map::values() function is an inbuilt function in PHP which is used to return a sequence of the map's values. Syntax: Ds\Sequence public Ds\Map::values ( void ) Parameters: This function does not accepts any parameters. Return Value: It returns a Ds\Sequence containing all the values of the map. Below programs illustrate the Ds\Map::values() function in PHP: Program 1: php <?php // Declare a new map $map = new \Ds\Map(["a" => "Geeks", "b" => "for", "c" => "Geeks"]); print_r($map->values()); // Declare another new map $map = new \Ds\Map(["b" => "Computer", "e" => "Science", "f" => "Portal"]); print_r($map->values()); ?> Output: Ds\Vector Object ( [0] => Geeks [1] => for [2] => Geeks ) Ds\Vector Object ( [0] => Computer [1] => Science [2] => Portal ) Program 2: php <?php // Declare a new map $map = new \Ds\Map(["Geeks1" => "computer", "Geeks2" => "science", "Geeks3" => 5, "Geeks4" => 20]); var_dump($map->values()); // Declare another new map $map = new \Ds\Map(["x" => "A", "y" => "B", "z" => "C"]); var_dump($map->values()); ?> Output: object(Ds\Vector)#2 (4) { [0]=> string(8) "computer" [1]=> string(7) "science" [2]=> int(5) [3]=> int(20) } object(Ds\Vector)#1 (3) { [0]=> string(1) "A" [1]=> string(1) "B" [2]=> string(1) "C" } Reference: https://www.php.net/manual/en/ds-map.values.php Comment More infoAdvertise with us Next Article PHP array_values() Function R R_Raj Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-ds_map Similar Reads PHP | DsMap values() Function The Ds\Map::values() function is an inbuilt function in PHP which is used to return a sequence of the map's values. Syntax: Ds\Sequence public Ds\Map::values ( void ) Parameters: This function does not accepts any parameters. Return Value: It returns a Ds\Sequence containing all the values of the ma 1 min read PHP array_values() Function The array_values() is an inbuilt PHP function is used to get an array of values from another array that may contain key-value pairs or just values. The function creates another array where it stores all the values and by default assigns numerical keys to the values.Syntax:array array_values($array)P 2 min read D3.js | d3.map.values() Function The map.values() function in D3.js used to return an array of values for every entry in the created map. The order of the returned values are arbitrary. Syntax: d3.map.values() Parameters: This function does not accept any parameters. Return Value: This function returns an array of values for every 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 | DsMap reverse() Function The Ds/Map::reverse() function in PHP is used to in-place reverse the elements of a specified Map instance. That is, the function in-place reverses the order of elements present in the specified Map instance. Syntax: Ds\Map public Ds\Map::reverse ( int $position ) Parameter: This function does not a 2 min read PHP | DsSequence map() Function The Ds\Sequence::map() function is an inbuilt function in PHP which returns the result after applying callback function to each value. Syntax: Ds\Sequence abstract public Ds\Sequence::map( $callback ) Parameter: This function accepts single parameter $callback. The callback apply on each value of se 1 min read PHP | DsSet slice() Function The Ds\Set::slice() function is an inbuilt function in PHP which is used to return the sub-set of given range. Syntax: Ds\Set public Ds\Set::slice ( int $index [, int $length ] ) Parameters: This function accepts two parameters as mentioned above and described below: $index: This parameter holds the 2 min read PHP | DsMap remove() Function The Ds\Map::remove() function is an inbuilt function in PHP which is used to remove and return a value by key. Syntax: mixed Ds\Map::remove( $key, $default ) Parameters: This function accepts two parameters as mentioned above and described below: $key: It holds the key value which need to remove. $d 2 min read PHP DsMap sum() Function The Ds\Map::sum() function of PHP is used to get the sum of all of the values present in the Map instance. Syntax: number public Ds\Map::sum ( void ) Parameters: This function does not accepts any parameter. Return value: This function returns the sum of all of the values present in the Map instance 1 min read Like