• PHP Video Tutorials

PHP - Ds Map copy() Function



Ds\Map::copy() function can return the shallow copy of a map.

Syntax

public Ds\Map Ds\Map::copy( void )

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

Example 1

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

Example 2

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