Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

displaying image

7 views
Skip to first unread message

richard

unread,
May 1, 2013, 12:31:58 PM5/1/13
to
http://mroldies.net/showtable.php?year=1960
Click on first link only.

I am using a 2d array and want to display an image based upon the number
key of that array.

<?php echo "<img src='$list[1]['cover']'>"; ?>

This line gives a place holder in firefox and in IE.
It should at least show this image.
http://mroldies.net/covers/1960-001.jpg

richard

unread,
May 1, 2013, 1:33:11 PM5/1/13
to
fixed!
put the entire tag into the array.
then echo the array.

Scott Johnson

unread,
May 1, 2013, 3:19:37 PM5/1/13
to
I think the problem you are having is you are using a 'complex' var in a
simple parse method (double quotes).

Once the engine hit the first closing array index bracket ']', the var
is done being parsed.

Try concatenate with '.'

<?php echo "<img src='" . $list[1]['cover'] . "'>"; ?>

or my favorite, use the complex type parsing with curlies.

<?php echo "<img src='{$list[1]['cover']}'>"; ?>

Scotty
0 new messages