Hello -
This echo line
echo "<img src=http://www.aslinside.com/images/\" ".$info_box_sorted[3][0]."\">";
puts the following broken image link on my page
http://www.aslinside.com/images/%22
$info_box_sorted is an array with a value of 5_little_monkeys.jpg
Can you tell me how to fix the code that concatenates the array value to the image URL?
Thank you,
Dave
Echo concatenation problem
Moderator: General Moderators
Re: Echo concatenation problem
Code: Select all
echo "<img src=http://www.aslinside.com/images/".$info_box_sorted[3][0].">";example:
Code: Select all
echo "hello";Code: Select all
echo "\"hello\"";so you had the following:
Code: Select all
echo "<img src=http://www.aslinside.com/images/\" ".$info_box_sorted[3][0]."\">";1) start your echo
echo
2) open a quote to start inserting the HTML you want PHP to send to your browser
"
2) type your html
<img src=http://www.aslinside.com/images/
3) close your quote so you can insert a PHP value in your echo
"
4) add a period to append your echo with more PHP
.
5) type in your variable you want displayed at that point in your echo string
$info_box_sorted[3][0]
5) add another period to append more to the string
.
6) open another quote to add more quoted HTML/TEXT
"
7) finish out your HTML (notice I put a forward slash as proper html image tags are the following: <img src='picture.jpg' />
/>
8) close the quote as we are done with quoted HTML
"
9) end your echo statement
;
Re: Echo concatenation problem
Thank you.