3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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);
based on bBDAA
Output for 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.30 - 7.3.0rc3
string(353) "<table cellSpacing="0" cellpadding="0" id="~~TableIDClass~~" class="ContainerTable"> <thead> <tr class="header"> <td class="TableTitle">~~TableName~~</td> </tr> </thead> <tbody class="~~TableIDClass~~ ClickableTableBody"> </tbody> <tfoot> <tr> <td norap colspan="5">$<span class="TableTotal"></span></td> </tr> </tfoot> </table> "