The Ds\Vector::clear() function is an inbuilt function in PHP which is used to clear the vector elements by removing all the elements from the vector.
void public Ds\Vector::clear( void )
Parameters: This function does not accept any parameter.
Return Value: This function does not return any value.
Below programs illustrate the Ds\Vector::clear() function in PHP:
Original Vector Ds\Vector Object (  => 1  => 2  => 3  => 4  => 5 ) Modified Vector Ds\Vector Object ( )
Original Vector Ds\Vector Object (  => geeks  => for  => geeks ) Modified Vector Ds\Vector Object ( )
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.