What's the safest way to destory/wipe out the arrays within the associative arrays?
| From: | Scott Fletcher | Date: | Wed, 05 Oct 2005 19:12:51 +0000 |
| Subject: | What's the safest way to destory/wipe out the arrays within the associative arrays? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-224045@lists.php.net to get a copy of this message | ||
[code]
$xml = array
(
'NEWSFEED' => array
(
'0' => array
(
'MESSAGE' => array
(
'0' => array
(
'ATTRIBUTES' => array
(
'ID' => 'test2',
'TID' => 'test4'
),
'TITLE' => array
(
'0' => array
(
'VALUE' => 'Title #1'
),
'1' => array
(
'VALUE' => 'Title #2'
)
),
'BODY' => array
(
'0' => array ( 'VALUE' => 'Body #1' )
),
'REFERENCE' => array
(
'0' => array ( 'VALUE' => 'Reference #1' )
)
),
'1' => array
(
'TITLE' => array
(
'0' => array ( 'VALUE' => 'Title #2' )
),
'BODY' => array
(
'0' => array ( 'VALUE' => 'Body #2' )
),
),
'2' => array
(
'ATTRIBUTES' => array
(
'ID' => 'test3'
),
'BODY' => array
(
'0' => array ( 'VALUE' => 'Body #3' )
),
)
)
)
),
);
echo
$xml['NEWSFEED']['0']['MESSAGE']['0']['BODY'];
echo
$xml['NEWSFEED']['0']['MESSAGE']['1']['BODY'];
echo
$xml['NEWSFEED']['0']['MESSAGE']['2']['BODY'];[/code]
What is the safest way to destroy or take out the
$xml['NEWSFEED']['0']['MESSAGE']['2']..... associative
arrays starting with
['2'] and those arrays inside of the ['2'] array path?
The unset() would make it not possible to reassign the data to this array
once again, that is what I do not want.
Thanks,
FletchSOD