0

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 Answers1

0

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>
rsmdh
  • 128
  • 1
  • 2
  • 12