Question : Obtain value from PHP array

The following code successfully returns a list of albums and display a list of photos in the form of an array which includes the location of the image. How can I display each photo. The PHP code does not seem to be picking up the "picture" element from the $photos array.

Here's a listing from the array:

 [5] => Array
                (
                    [id] => 1332594
                    [from] => Array
                        (
                            [name] => Art
                            [category] => Artist
                            [id] => 132450056
                        )

                    [picture] => http://photos-g.ak.fbcdn.net/hphotos-ak-snc4/hs194.snc4/38020_133259403380146_162531_1147152_s.jpg
                    [source] => http://sphotos.ak.fbcdn.net/hphotos-ak-snc4/hs194.snc4/38020_133259403380146_162531_1147152_n.jpg
                    [height] => 432
                    [width] => 720
                    [link] => http://www.facebook.com/photo.php?pid=131&id=056794414
                    [icon] => http://static.ak.fbcdn.net/rsrc.php/z2E5Y/hash/8as8iqdm.gif
                    [created_time] => 2010-07-18T14:22:37+0000
                    [updated_time] => 2010-07-18T14:22:40+0000
                )
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
<?php
$albums = $facebook->api('/13245005674/albums?access_token='.$session['access_token']);
$photos = $facebook->api('/13336713486/photos?access_token='.$session['access_token']);
?>

<h3>Albums</h3>
<pre><?php print_r($albums); ?></pre>
<h3>Photos</h3>
<pre><?php print_r($photos); ?></pre>
<h3>Picture</h3>
<?php
 foreach ($photos as $photo) {
        echo "<img src=\"{$photo['picture']}\">\n";
        }
?>

Answer : Obtain value from PHP array

You can see below a shot of a truncated client applet connecting to your existing server. Note the Java Console trace and the use of param tags:

Random Solutions  
 
programming4us programming4us