PHP | Ds\Map skip() Function Last Updated : 21 Aug, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The Ds\Map::skip() function is an inbuilt function in PHP, which is used to return the pair at a given positional index. Syntax: Ds\Pair public Ds\Map::skip ( int $position ) Parameter: This function accepts single parameter $position which is used to return the zero-based positional index. Return value: It returns the Ds\Pair at the given position. Below programs illustrate the Ds\Map::skip() function in PHP: Program 1: php <?php // Declare a new map $map = new \Ds\Map(["a" => 1, "b" => 3, "c" => 5]); print_r($map->skip(1)); // Declare another new map $map = new \Ds\Map(["1" => "Geeks", "2" => "for", "3" => "Geeks"]); print_r($map->skip(2)); ?> Output: Ds\Pair Object ( [key] => b [value] => 3 ) Ds\Pair Object ( [key] => 3 [value] => Geeks ) Program 2: php <?php // Declare a new map $map = new \Ds\Map(["Geeks1" => "computer", "Geeks2" => "science", "Geeks3" => 5, "Geeks4" => 20]); print_r($map->skip(0)); // Declare another new map $map = new \Ds\Map(["x" => "A", "y" => "B", "z" => "C"]); print_r($map->skip(1)); ?> Output: Ds\Pair Object ( [key] => Geeks1 [value] => computer ) Ds\Pair Object ( [key] => y [value] => B ) Reference: https://www.php.net/manual/en/ds-map.skip.php Comment More infoAdvertise with us Next Article PHP | Ds\Map skip() Function R R_Raj Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-ds_map Similar Reads 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 | 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 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