PHP Interpolating In Here Document – String Function

<?
$page_title = 'Menu';
$meat = 'pork';
$vegetable = 'vvv';
print <<<menu
<html>
<head><title>$page_title</title></head>
<body>
<ul>
<li> $meat
<li> $meat
<li> $meat with $vegetable
</ul>
</body>
</html>
MENU;
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.