PHP Ds / Set remove () Function

PHP

Syntax:
void public DsSet::remove ([mixed $... values])
Parameter:This function takes a comma-separated list of values ​​to remove from the set as a parameter.Return Value:This function does not return any value. The programs below illustrate the Ds / Set::remove()function:Program 1:  
// Declare the set $set = new DsSet ([1, 2, 3, 4, 5]);  
// Corresponding array echo "Actual Set is:" ; print_r ( $set );  
// Remove values ​​ $set -> remove (3, 4); echo " Set after removing values: " ; print_r ( $set );  
?>
Exit:
Actual Set is : DsSet Object ([0] = > 1 [1] = > 2 [2] = > 3 [3] = > 4 [4] = > 5) Set after removing values: DsSet Object ([0 ] = > 1 [1] = > 2 [2] = > 5)
Program 2:  
// Declare the set $set = new DsSet ([ "Welcome" , 2, " Geeks " ]);  
// Corresponding array echo "Actual Set is:" ; print_r ( $set );  
// Remove values ​​ $set -> remove (2); echo " Set after removing values: " ; print_r ( $set );  
?>
Exit:
Actual Set is : DsSet Object ([0] = > Welcome [1] = > 2 [2] = > Geeks) Set after removing values: DsSet Object ([0] = > Welcome [1] = > Geeks)
Link: http://php.net/manual/en /ds-set.remove.php



Get Solution for free from DataCamp guru