Voting

: max(four, five)?
(Example: nine)

The Note You're Voting On

Adil Baig @ AIdezigns
13 years ago
Make sure you use this function to unset a value. You can't access this iterator's values as an array. Ex:

<?php
$iterator
= new \RecursiveIteratorIterator(new \RecursiveArrayIterator($arr));

foreach(
$iterator as $key => $value)
{
unset(
$iterator[$key]);
}
?>

Will return :

PHP Fatal error: Cannot use object of type RecursiveIteratorIterator as array

offsetUnset works properly even when removing items from nested arrays.

<< Back to user notes page

To Top