displaying image

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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.

Re: displaying image

On Wed, 1 May 2013 12:31:58 -0400, richard wrote:

Quoted text here. Click to load it

put the entire tag into the array.
then echo the array.

Re: displaying image

On 5/1/2013 9:31 AM, richard wrote:
Quoted text here. Click to load it

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=''>"; ?>


Site Timeline