Jump to content

Foreach Loop Question


ds111

Recommended Posts

Hi!

I have an array like this:

 

[test1] =>
[test2] =>
[test3] => Array
    (
        [archives] => Array
            (
                [file] => application/hooks/archives.php
                [function] => archives
            )

    )

 

How can I make a foreach loop so that it takes the "archives" text out of test 'test3' index? Afterwards, I then need to take the "file" and "function" out, also in the foreach loop.

 

I also need an "if" statement, to check if there is anything in the 'test1' index as well.

All 3 indexes will be called, and I need to loop through each of them. If there is anything there, I need to loop through those, and include the "file" one.

Link to comment
https://forums.phpfreaks.com/topic/185978-foreach-loop-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.