Multi Dimensional Array help

Ok, so I am trying to get som help with some multi dimensional arrays. My page is

http://www.ryandavis.co/hosted/ctct/RyansProject.php

Here is my programming:

[php]$Campaigns = $ConstantContact->getCampaigns();

$getDetails = $ConstantContact->getCampaignDetails($Campaigns[campaigns][0]);

$getStatus = $ConstantContact->getCampaignsByStatus(‘sent’);

echo “

”;
print_r ($getDetails);
echo “
”;
[/php]

I am printing the Status although that is just to show how this array is set up. The details is what I want and I have to pass it a number “[0]” to get data from my API. What i would like to do is create a foreach loop that will echo the the name. I know that by using saying $EmailName = $getDetails->name; should work. But i can not wrap my head around how to do this. Any help would be appreciated

I recently created a few multi-dimensional arrays… I used this website to trouble shoot my issues.
http://www.elated.com/articles/php-multidimensional-arrays/

I’ll take a quick stab at this. It looks as though you’re returning an array from your class. If so, then instead of:

“$EmailName = $getDetails->name”

use the equal sign and make it

“$EmailName = $getDetails=>name”

Hope this helps.

Sponsor our Newsletter | Privacy Policy | Terms of Service