display an img src inside html then php

Viewed 15

I would like to ask how to display an img src like this:

<html>

<?php

$extradata = (Data for this come from database that I decode)

$profilepicturefinalpath = "/folder/folder/".$extradata;

echo '<img src="<?php echo $profilepicturefinalpath ?>"/>';

?>

</html>

What should I do, Is this possible?

Please help, I am just a newbie

1 Answers

Please try below code. Normal echo with double quotes or heredoc

<html>
<body>
<?php
$extradata = (Data for this come from database that I decode)
$profilepicturefinalpath = "/folder/folder/".$extradata;

echo <<<EOQ
<img src="{$profilepicturefinalpath}" />
EOQ;
echo '<BR>';
echo "<img src='{$profilepicturefinalpath}' />"
echo '<BR>';
?>
</body>
</html>
Related