- var_dump: documentation ( source)
- preg_replace: documentation ( source)
<?php
$Template = <<<'TEMPLATE'
<table cellSpacing="0" cellpadding="0" id="~~TableIDClass~~" class="ContainerTable">
<thead>
<tr class="header">
<td class="TableTitle">~~TableName~~</td>
</tr>
</thead>
<tbody class="~~TableIDClass~~ ClickableTableBody">
~~TemplateStart~~
<tr data-type="~~Data-Type~~" data-id="~~Data-ID~~" data-date="~~Data-Date~~" data-cost="~~Data-Cost~~" class="TableText clickable AddMee">
<td nowrap class="DateColumn">~~Date~~</td>
<td nowrap class="JarColumn"></td>
<td nowrap class="CategoryColumn">~~Category~~</td>
<td nowrap class="NotesColumn">~~Note~~</td>
<td nowrap class="CostColumn">~~DefaultCostDot~~$~~Cost~~</td>
</tr>
~~TemplateEnd~~
</tbody>
<tfoot>
<tr>
<td norap colspan="5">$<span class="TableTotal"></span></td>
</tr>
</tfoot>
</table>
TEMPLATE;
$data = preg_replace('/~~TemplateStart~~[\s\S]+?~~TemplateEnd~~/', '', $Template);
var_dump($data);