Re: RE: removing an array from a compound array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



yes,i agree with Mike's method.


2009-07-02 



zhoo 



发件人: Ford, Mike 
发送时间: 2009-07-02  15:12:20 
收件人: Andres Gonzalez; php-general@xxxxxxxxxxxxx 
抄送: 
主题: RE: [PHP] removing an array from a compound array 
 
> -----Original Message-----
> From: Andres Gonzalez [mailto:andres@xxxxxxxxxxxxxxx]
> Sent: 02 July 2009 00:46
> To: php-general@xxxxxxxxxxxxx
> Subject: [PHP] removing an array from a compound array
> 
> I have a compound array, that is, an array of an array of an array,
> etc,
> that is about 5 arrays
> deep. I currently search thru all of these arrays, and based on some
> criteria, I want to delete
> one of the arrays (along with all of its sub-arrays) in the middle.
> 
> What is the easiest way to delete such an "embedded" array?
If you know all the keys leading to the subarray you want to remove
(which you probably do if you've just searched your way to it), then a
simple unset() should work, similar to:
    Unset($array[$key1][$key2][$key3]);
Cheers!
Mike
 --
Mike Ford,  Electronic Information Developer,
C507, Leeds Metropolitan University, Civic Quarter Campus, 
Woodhouse Lane, LEEDS,  LS1 3HE,  United Kingdom
Email: m.ford@xxxxxxxxxxxxxx
Tel: +44 113 812 4730
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux