Open In App

PHP | ArrayIterator offsetUnset() Function

Last Updated : 21 Nov, 2019
Comments
Improve
Suggest changes
Like Article
Like
Report
The ArrayIterator::offsetUnset() function is an inbuilt function in PHP which is used to unset the value for an offset. Syntax:
void ArrayIterator::offsetUnset( mixed $index )
Parameters: This function accepts single parameter $index which holds the index to unset the offset. Return Value: This function does not return any value. Below programs illustrate the ArrayIterator::offsetUnset() function in PHP: Program 1:
Output:
int(4)
NULL
int(8)
NULL
int(9)
NULL
Program 2:
Output:
Geeks
NULL
for
NULL
Geeks
NULL
Reference: https://www.php.net/manual/en/arrayiterator.offsetunset.php

Next Article

Similar Reads