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. Quote Link to comment https://forums.phpfreaks.com/topic/291902-insert-image/ Share on other sites More sharing options...
Solution requinix Posted October 18, 2014 Solution Share Posted October 18, 2014 Please help because... the image isn't working? You have your quoting mixed up: echo ''; Quote 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! Quote Link to comment https://forums.phpfreaks.com/topic/291902-insert-image/#findComment-1494067 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.