Home  |  Linux  | Mysql  | PHP  | XML
From:Andres Gonzalez Date:Thu Jul  2 13:18:21 2009
Subject:Re: removing an array from a compound array
Duh! I should have known that.

I actually tried that and had a problem so I thought unset() would not work
on an array. Guess that problem was elsewhere.

Thanks for the responses...

-Andres



Ford, Mike wrote:
>> -----Original Message-----
>> From: Andres Gonzalez [mailto:andres@packetstorm.com]
>> Sent: 02 July 2009 00:46
>> To: php-general@lists.php.net
>> 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@leedsmet.ac.uk
> 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
>
>
Navigate in group php.general at sever news.php.net
Previous Next


Your recent visits
LMPX.COM :: Linux, Mysql, Php, Xml
generally, where in cPanel can one set the default page to load?
LMPX.COM :: Linux, Mysql, Php, Xml
Re: [PHP] Re: PHP 5.3.0 Released!
Re: [PHP] Apache module PHP 5.3 on Windows



  
© No Copyright
You are free to use Anything, but please consult your advocate before doing so as this website
also list content from other sources which may be copyrighted.
Site Maintained by Zareef Ahmed
Powered By PHP Consultants