mstevens Posted October 18, 2014 Share Posted October 18, 2014 Ok, so I have a variable named $zodiac that is running through an array, based on the year chosen, and selecting the appropriate animal! I also have an Images folder containing a pic of each of the zodiac animals. I want to insert the images based on the $zodiac array animal chosen, so as an example... <?php echo '<img src="Images\" . $zodiac . ".jpg">'; ?> Please help. Link to comment https://forums.phpfreaks.com/topic/291902-insert-image/ Share on other sites More sharing options...
requinix Posted October 18, 2014 Share Posted October 18, 2014 Please help because... the image isn't working? You have your quoting mixed up: echo ''; Link to comment https://forums.phpfreaks.com/topic/291902-insert-image/#findComment-1494065 Share on other sites More sharing options...
mstevens Posted October 18, 2014 Author Share Posted October 18, 2014 Please help because... the image isn't working? You have your quoting mixed up: echo '<img src="Images' . $zodiac . '.jpg">'; Yes, the image does not display, just a broken image. ...and great news, that worked like a charm, thank you very much! Link to comment https://forums.phpfreaks.com/topic/291902-insert-image/#findComment-1494067 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.