PHP Ds\Set get() Function Last Updated : 16 Aug, 2019 Comments Improve Suggest changes Like Article Like Report The Ds\Set::get() function of Ds\Set class in PHP is an inbuilt function which is used to get a value from the Set instance. This function is used to fetch a value present at a particular index in the Set instance. Syntax: mixed public Ds\Set::get ( int $index ) Parameters: This function accepts a single parameter $index which represents the index position in the Set from where the value is to be fetched. Return Value: This function returns the present at the index $index in the Set instance. Below programs illustrate the Ds\Set::get() function: Program 1: php <?php // Declare new Set $set = new \Ds\Set([10, 15, 21]); // Display the Set element var_dump($set); // Display value at index 2 echo "Value at index 2 is : "; print_r($set->get(2)); ?> Output: object(Ds\Set)#1 (3) { [0]=> int(10) [1]=> int(15) [2]=> int(21) } Value at index 2 is : 21 Program 2: php <?php // Declare new Set $set = new \Ds\Set(["Geeks", "for", "Keegs"]); // Display the Set element var_dump($set); // Display the value at index 0 echo "Value at index 0 is : "; print_r($set->get(0)); ?> Output: object(Ds\Set)#1 (3) { [0]=> string(5) "Geeks" [1]=> string(3) "for" [2]=> string(5) "Keegs" } Value at index 0 is : Geeks Reference: http://php.net/manual/en/ds-set.get.php Comment More infoAdvertise with us Next Article PHP | DsVector get() Function G gopaldave Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-ds_set Similar Reads PHP DsSet get() Function The Ds\Set::get() function of Ds\Set class in PHP is an inbuilt function which is used to get a value from the Set instance. This function is used to fetch a value present at a particular index in the Set instance. Syntax: mixed public Ds\Set::get ( int $index ) Parameters: This function accepts a s 2 min read PHP | DsVector get() Function The Ds\Vector::get() function is an inbuilt function in PHP which is used to return the element at the given index. Syntax: mixed public Ds\Vector::get( $index ) Parameters: This function accepts a single parameter $index which contains the index (0-based indexing) at which the element is to be retu 1 min read PHP | date_timestamp_get() Function The date_timestamp_get() function is an inbuilt function in PHP which is used to gets the Unix timestamp. This function returns the Unix timestamp representing the date. Syntax: Procedural style: int date_timestamp_get( $object ) Object oriented style: int DateTime::getTimestamp( void ) int DateTime 1 min read PHP | unset() Function In PHP, the unset() function is used to destroy a variable, array element, or object. Once a variable or array element is "unset", it is completely removed from memory, and it no longer exists in the program. This function is essential for freeing up memory by removing unwanted or unnecessary data d 3 min read PHP reset() Function The reset() function is an inbuilt function in PHP. This function is used to move any array's internal pointer to the first element of that array. While working with arrays, it may happen that we modify the internal pointer of an array using different functions like prev() function, current() functi 2 min read PHP | get_defined_vars() Function The get_defined_vars() function is an inbuilt function in PHP which is used to returns an array of all defined variables. This function returns a multidimensional array which contains all the list of variables, environment etc. Syntax: array get_defined_vars( void ) Parameters: This function does no 1 min read Like