PHP | Ds\Sequence remove() Function
The Ds\Sequence::remove() function is an inbuilt function in PHP which is used to remove and return a value by index.
Syntax:
Ds\Sequence::remove( $index )
Parameters: This function accepts single parameter $index which holds the index of value to remove.
Return Value: This function returns the value that was removed.
Below programs illustrate the Ds\Sequence::remove() function in PHP:
Program 1:
<?php // Declare a sequence $seq = new \Ds\Vector(["Geeks", "Hello", "GFG"]); // Use remove() function var_dump($seq->remove(2)); var_dump($seq->remove(0)); ?> |
string(3) "GFG" string(5) "Geeks"
Program 2:
<?php // Declare a sequence $seq = new \Ds\Vector([1, 3, 5, 7, 8, 9]); // Use remove() function $seq->remove(5); $seq->remove(3); $seq->remove(2); $seq->remove(0); var_dump($seq->remove(1)); ?> |
int(8)
Reference: https://www.php.net/manual/en/ds-sequence.remove.php
Recommended Posts:
- D3.js | d3.map.remove() Function
- D3.js | d3.set.remove() function
- PHP | Ds\Map remove() Function
- PHP Ds\Set remove() Function
- PHP | Ds\Vector remove() Function
- PHP | Ds\Deque remove() Function
- PHP | Ds\Vector remove() Function
- How to remove style added with .css() function using JavaScript?
- How to remove error Call to undefined function curl_init()?
- Remove a cookie using PHP
- How to fadeOut and remove a div using jQuery ?
- How to remove non-alphanumeric characters in PHP?
- How to remove the first character of string in PHP?
- Remove new lines from string in PHP
- How to remove underline for anchors tag using CSS?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



