I am looking for some help putting some PHP code inside an HTML attribute. I can't seem to make it work. I think I am escaping the quotes incorrectly or the php is not being concatenated with the html, but I can't seem to figure out. Can someone please offer some advice. Should I put the HTML inside php string and echo is out that way?
<?php $icon_hospital = htmlspecialchars('http://s15.postimg.org/6ct1w2o5z/hospitals.png'); ?>
<?php echo $icon_hospital; ?>
<img src="https://maps.googleapis.com/maps/api/staticmap?size=400x400&markers=icon:"<?php echo $icon_hospital ; ?>"%7CAlbany,+NY&sensor=false">