show Image from URL with image ID -syntax question

images php coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
sheaila
New php-forum User
New php-forum User
Posts: 1
Joined: Tue Nov 06, 2018 3:53 am

Tue Nov 06, 2018 4:12 am

Hi there,

Trying to parse an image using the image id .
The first line works and shows the image URL: https://www.kiva.org/img/2992239.jpg
The second line does not show the image and I am guessing that there is an error in the syntax. Could someone see it and make this work?

Thanks so much!
Sheaila

Code: Select all

$output.= "Image Source: http://www.kiva.org/img/" .$loans['image']['id']. ".jpg/>";

$output.= "<img src='http://www.kiva.org/img/'".$loans['image']['id'].".jpg/>";

User avatar
hyper
php-forum Fan User
php-forum Fan User
Posts: 747
Joined: Mon Feb 22, 2016 5:52 pm

Tue Nov 06, 2018 1:23 pm

Code: Select all

'http://www.kiva.org/img/'
 http://www.kiva.org/img/
You've closed the filename in the second line.

Post Reply