Removing Elements from Arrays : unset « Data Type « PHP






Removing Elements from Arrays

 
<?php 
$dogs = array('A' => 'C', 'B' => 'D','X' => 'Y', 'Q' => 'T'); 
printf("%s,", var_export($dogs, TRUE)); 

unset($dogs['X']); 
printf("%s,", var_export($dogs, TRUE)); 
?>
  
  








Related examples in the same category

1.Removing Session Data
2.Deleting an object
3.void unset ( mixed var [, mixed var [, mixed ...]] )
4.Using the unset() Function
5.Removing Elements