• PHP Video Tutorials

PHP - Ds Set xor() Function



Ds\Set::xor() function can create a new set by using the values in the current instance and another set but not in both.

Syntax

public Ds\Set Ds\Set::xor( Ds\Set $set )

Ds\Set::xor() function can return a new set containing values in the current instance as well as another set but not in both.

Example

<?php  
   $set1 = new \Ds\Set([2, 3, 6, 7, 8]);  
   $set2 = new \Ds\Set([2, 3, 5, 8, 10]);  
  
   echo("The xor of both set: \n");  
   var_dump($set1->xor($set2)); 
?>
php_function_reference.htm
Advertisements