I have variable containing both text and variables (as text) such as the following
$variable = 'something';
$string = 'this is my string that contains a $variable in text form, but i want the variable to actually contain $variable when i echo it';
and what im trying to achieve is by echoing that string, it turns the variables into the correct text which would make the above sentence something like
echo $string;
should result in
"this is my string that contains a something in text form, but i want the variable to actually contain something when i echo it"
Thank you for any help
Edit.
I've tried double quotes like echo "$string"; however its still echos it as text. im getting the variable via a simple query
$answer_id = $row0['id'];
<div class="text">
<?php echo "$answer_id"; ?>
</div>
This still outputs a string without variables