I’ve been trying the heredoc method like this:
<?php echo $form = <<<HTML ?>
here follows the html...
<form method="post" >
<table border="0" cellpadding="0" cellspacing="0" id="reserv_table">
<tr>
<td><span id="message"><b>for you : 9€</b> </span></td>
<td><input type="text" name="_membre" id="_membre" style="width: 40px;" class="text disabled" disabled="disabled" /></td>
<td valign="top">
<table>
<tr>
<?php HTML; ?>
But I get an error.
If you’re just echoing the form you don’t even need PHP’s heredoc syntax. Just break out of PHP using the closing delimiter, then return to PHP once you’re done outputting the HTML form.
EDIT: OK, so you need the form output to be stored in a variable, but you also want it to be printed to the browser? No problem, use output buffering (in particular,
ob_start()andob_get_flush():