Solved

Help with an array

Posted on 2009-05-20
2
173 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
2 Comments
 
LVL 7

Accepted Solution

by:
ycTIN earned 500 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now