TheFilmGod Posted February 20, 2007 Share Posted February 20, 2007 I'm using html to load a pic. <img src="image/1.jpg"> but to make it easy I want to make the "1" in the above to be a php variable so that I can edit it easy. Here is my code: <html> ... <?php $num="1"; ?> ...... <img src="image/<?php $num; ?>.jpg"> why doesn't it work? Link to comment https://forums.phpfreaks.com/topic/39259-solved-easy-stuff-but-help/ Share on other sites More sharing options...
Jessica Posted February 20, 2007 Share Posted February 20, 2007 You're not printing the variable. <img src="image/<?=$num?>.jpg"> or <img src="image/<?php print $num; ?>.jpg"> Link to comment https://forums.phpfreaks.com/topic/39259-solved-easy-stuff-but-help/#findComment-189177 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.