Freedom-n-Democrazy Posted September 16, 2011 Share Posted September 16, 2011 How can this be written in PHP? echo '<IMG alt="" src=".$row['id']/thumb.png">'; Link to comment https://forums.phpfreaks.com/topic/247248-embeding-php-inside-a-html-attribute/ Share on other sites More sharing options...
Pikachu2000 Posted September 16, 2011 Share Posted September 16, 2011 There are a few different ways. echo "<IMG alt=\"\" src=\"{$row['id']}/thumb.png\">"; // OR // echo '<IMG alt="" src="' . $row['id'] . '/thumb.png">'; Link to comment https://forums.phpfreaks.com/topic/247248-embeding-php-inside-a-html-attribute/#findComment-1269792 Share on other sites More sharing options...
Freedom-n-Democrazy Posted September 16, 2011 Author Share Posted September 16, 2011 I chose the second one because all the slashes in the first looked confusing. Thanks allot Pikachu2000. Link to comment https://forums.phpfreaks.com/topic/247248-embeding-php-inside-a-html-attribute/#findComment-1269795 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.