• PHP Video Tutorials

PHP - Ds Set isEmpty() Function



Ds\Set::isEmpty() function can return whether the set is empty.

Syntax

public bool Ds\Set::isEmpty( void )

Ds\Set::isEmpty() function doesn't have any parameters.

Ds\Set::isEmpty() function can return true if the set is empty, or false otherwise.

Example 1

<?php  
   $set = new \Ds\Set();  
   var_dump($set);  
 
   if($set->isEmpty()) 
      echo "The set is empty";   
?>  

Example 2

<?php  
   $set = new \Ds\Set(["Tutorials", "Point", "India"]);  
   var_dump($set);  
     
   if($set->isEmpty()==0) 
      echo "The set is not empty";
?>
php_function_reference.htm
Advertisements