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 GURU
php-forum GURU
Posts: 854
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.
jamesbyars
New php-forum User
New php-forum User
Posts: 1
Joined: Thu Dec 27, 2018 5:33 am

Thu Dec 27, 2018 5:37 am

Guys, hanks so much for the description! I think I understood vital aspects which is indeed nice!
http://bigessaywriter.com/blog/critical-thinking-essay-writing-write-and-think
Post Reply