Unsets the value at the specified index with ArrayObject::offsetUnset in PHP

Description

The following code shows how to unsets the value at the specified index with ArrayObject::offsetUnset.

Example


//example revised from php.net//  www.  j a va  2  s.  co m
<?php
$arrayobj = new ArrayObject(array(0=>'zero',2=>'two'));
$arrayobj->offsetUnset(2);
var_dump($arrayobj);
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Data Types »




Array
Array Associative
Array Util
ArrayObject
Data Types
Date
Date Format
DateTime
Number
String
String Escape
String Filter
String HTML
String Type
Timezone