Interpolating in a here document : here document « String « PHP






Interpolating in a here document

 
<?
$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;
?>
  
  








Related examples in the same category

1.Concatenation with a here document
2.Defining a here document
3.More here documents
4.Printing HTML with a here document