The Ds\Vector::first() function is an inbuilt function in PHP which is used to find the first element in the vector.
mixed public Ds\Vector::first( void )
Parameters: This function does not accept any parameter.
Return Value: This function returns the first element present in the vector.
Below programs illustrate the Ds\Vector::first() function in PHP:
First element of the vector: int(1)
First element of the vector: string(5) "geeks"
- Difference between :first-child and :first-of-type selector in CSS
- How to merge the first index of an array with the first index of second array?
- PHP | Ds\Sequence first() Function
- PHP | Ds\Map first() Function
- PHP | Ds\Deque first() Function
- PHP | Ds\Set first() Function
- How to get the first element of an array in PHP?
- How to remove the first character of string in PHP?
- Determine the first and last iteration in a foreach loop in PHP?
- How to get first day of week in PHP?
- How to get the first word of a sentence in PHP?
- Collect.js | first() Function
- How to get the function name inside a function in PHP ?
- PHP 5 vs PHP 7
- PHP | Get PHP configuration information using phpinfo()
- PHP | php.ini File Configuration
- How to import config.php file in a PHP script ?
- Flask - (Creating first simple application)
- Underscore.js | first() with Examples