Removing Arrays With Certain Keys From Larger Array

This is a discussion on Removing Arrays With Certain Keys From Larger Array within the PHP General forums, part of the PHP Programming Forums category; I have an array exampled below. I want to remove and use certain nested arrays from the larger array where ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-08-2003
Jwulff
 
Posts: n/a
Default Removing Arrays With Certain Keys From Larger Array

I have an array exampled below. I want to remove and use certain nested
arrays from the larger array where the key == title, size, day, etc... How
does an idiot like myself accomplish this?

Array
(
[0] => Array
(
[0] => title
[1] => by Month for Melvin
)

[1] => Array
(
[0] => Jan-99
[1] => 5286.69
[2] => 4687.89
[3] => 88.71
[4] => 98.05
[5] => 9.04
)
)


Reply With Quote
  #2 (permalink)  
Old 07-08-2003
Steve Keller
 
Posts: n/a
Default Re: [PHP] Removing Arrays With Certain Keys From Larger Array

At 7/8/2003 02:18 PM, jwulff wrote:

> I have an array exampled below. I want to remove and use certain nested
> arrays from the larger array where the key == title, size, day, etc... How
> does an idiot like myself accomplish this?


You can reference it the same as you reference any other array. For
example, you used "print_r" to display the sample array, to print a sub
array you do the same thing:

print_r($myArray[0]);

That'll print the array under the "0" key.

If you wanted element 1 of the array under key 0, then you'd do something like

$myValue = $myArray[0][1];

Hope this helps.

--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: skeller@healthtvchannel.org
Web: www.healthtvchannel.org

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:05 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0