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 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 PHP get_resource_id() Function The get_resource_id() function is an inbuilt function in PHP that returns the integer id given resource. This function provides a safe way of generating integers for a resource. Syntax: get_resource_id($resource) ;Parameters: This function accepts one parameter that are described below: $resource: 1 min read PHP | stream_get_meta_data() Function The stream_get_meta_data() function is an inbuilt function in PHP which is used to get the header or meta data from the streams/file pointers.Syntax: array stream_get_meta_data( $stream ) Parameters: The function accepts single parameter $stream, which specifies the meta data to be retrieve and whic 2 min read PHP | headers_sent() function The headers_sent() function is an inbuilt function in PHP which is used to determines whether the header is successfully sent or not. The headers_sent() function returns True if header sent successfully and False otherwise. Syntax: bool headers_sent( $file, $line ) Parameters: This function accepts 3 min read PHP | settype() Function The settype() function is a built-in function in PHP. The settype() function is used to the set the type of a variable. It is used to set type or modify type of an existing variable. Syntax: boolean settype($variable_name, $type) Parameters: The settype() function accepts two parameters as shown in 2 min read Like