Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Help with an array

Posted on 2009-05-20
2
Medium Priority
?
185 Views
Last Modified: 2012-05-07
Hi all,

I have a variable $result that outputs the chunck below.
I need to get all the [theurl] in the array .. how can I do it??

Thanks in advance!!

Array
(
    [myfunction] => Array
        (
            [root] => Array
                (
                    [node] => Array
                        (
                            [0] => Array
                                (
                                    
                                    [theurl] => http://myweb.com/tests/1.html
                                    [theimageurl] => http://myweb.com/tests/images/1.jpg
      
                                )
 
                            [1] => Array
                                (
                                    [theurl] => http://myweb.com/tests/2.html
                                    [theimageurl] => http://myweb.com/tests/images/2.jpg
                                )
 
                            [2] => Array
                                (
                                   [theurl] => http://myweb.com/tests/3.html
                                    [theimageurl] => http://myweb.com/tests/images/3.jpg
                                )
 
                            [3] => Array
                                (
                                     [theurl] => http://myweb.com/tests/4.html
                                    [theimageurl] => http://myweb.com/tests/images/4.jpg
                                )
 
                        )
 
                )
 
        )
 
)

Open in new window

0
Comment
Question by:Dada44
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
ycTIN earned 2000 total points
ID: 24434194

$source = "your array";
 
foreach ($source['myfunction']['root']['node'] as $node) {
	echo $node['theurl'];
}

Open in new window

0
 

Author Closing Comment

by:Dada44
ID: 31583608
thanks!!
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question