The Ds\Set::first() function is an inbuilt function in PHP which returns the first element of the Set.
Syntax:
void public Ds\Set::first( void )
Parameter: This function does not accept any parameter.
Return value: This function returns the first value of the Set.
Below programs illustrate the Ds\Set::first() function in PHP:
Program 1:
PHP
<?php// PHP program to illustrate the // Ds\set::first() function // Create a set instance$set = new \Ds\Set();// Adding elements to Set$set->add("Welcome");$set->add("to");$set->add("GfG");// Print the first element from setprint_r($set->first());?> |
Welcome
Program 2:
PHP
<?php// PHP program to illustrate the // Ds\set::first() function // Create a set instance$set = new \Ds\Set();// Adding elements to Set$set->add("10");$set->add("20");$set->add("30");// Print the first element from setprint_r($set->first());?> |
10
Reference: http://php.net/manual/en/ds-set.first.php

… [Trackback]
[…] Read More Info here on that Topic: geeksforgeeks.org/php-ds-set-first-function-2/ […]
… [Trackback]
[…] Read More to that Topic: geeksforgeeks.org/php-ds-set-first-function-2/ […]
… [Trackback]
[…] Here you will find 81857 more Info to that Topic: geeksforgeeks.org/php-ds-set-first-function-2/ […]
… [Trackback]
[…] Information on that Topic: geeksforgeeks.org/php-ds-set-first-function-2/ […]
… [Trackback]
[…] Read More Info here to that Topic: geeksforgeeks.org/php-ds-set-first-function-2/ […]
… [Trackback]
[…] Find More on to that Topic: geeksforgeeks.org/php-ds-set-first-function-2/ […]