The Ds\Vector::count() function is an inbuilt function in PHP which is used to count the number of elements in the vector.
int public Ds\Vector::count( void )
Parameters: This function does not accepts any parameter.
Return Value: This function returns the number of elements in the vector.
Below programs illustrate the Ds\Vector::count() function in PHP:
Vector elements Ds\Vector Object (  => 1  => 2  => 3  => 4  => 5  => 6  => 7  => 8 ) Count vector elements: 8
Vector elements Ds\Vector Object (  => geeks  => for  => geeks ) Count vector elements: 3
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.