• PHP Video Tutorials

PHP - Ds Map keys() Function



Ds\Map::keys() function can return the set of map's keys.

Syntax

public Ds\Set Ds\Map::keys( void )

Ds\Map::keys() function can return a set containing all keys of a map in the same order.

Ds\Map::keys() function doesn't have any parameters.

Ds\Map::keys() function can return Ds\Set containing all keys of a map.

Example 1

<?php 
   $map = new \Ds\Map([1 => "Tutorials", 2 => "Point", 3 => "India"]); 
   print_r($map->keys());
?>

Example 2

<?php 
   $map = new \Ds\Map(["first" => "Tutorials", "second" => "Point", "third" => "India"]); 
   print_r($map->keys()); 
?>
php_function_reference.htm
Advertisements