Im trying to have php code that contains an echo. within that echo however, I need it to echo php code within it. a short example is bellow.
<!php echo '<?php echo "test"; ?>'; ?>
My main reason for this is that I will be using a mysql_fetch_array while loop that echoes out some html and $row[] information in it but also needs php in it. Bellow I have put what I actually need to be done.
while ($row = mysql_fetch_array($result)) {
echo '<div style="position: relative;" >
<img src="Backgrounds/'. $row[id] .'.jpg" alt="error">
<br /><br />
<?php
Some php content that also uses $row[] content
?>
<br />
</div>';
}
My only problem is that when I inspect element in chrome, it turns out like this
while ($row = mysql_fetch_array($result)) {
echo '<div style="position: relative;" >
<img src="Backgrounds/'. $row[id] .'.jpg" alt="error">
<br /><br />
<!--?php
Some php content that also uses $row[] content
?-->
<br />
</div>';
}
and it turns the php part into comments for html. Im not sure what to do here.
evalis probably what you want. php.net/eval