This code is broken because I am nesting php code blocks. What is the proper way to do this?
<?php
if ($prev_ID > $totalRows_totalBoogerRows)
{
echo "";
}
else
{
echo <<<_END
<div class='paging_button_left paging_button_left_episode'>
<a href='episode.php?post_ID=<?php echo $prev_ID; ?>'>
<h4 style='text-align: right;'>Ep. <?php echo $prev_ID; ?>
</h4>
</a>
</div>"
_END;
}
?>
I breaks on line 11 because my closing PHP tag closes the first PHP opening tag on line one (I want it to only close the opening PHP tag on line 11). Also, I may be using <<<_END wrong.
When you are echoing a string that needs php variables inserted, do not open and close php tags but use string concatenation: