I have a variable including html structure like following:
$txt = '<table>
<tr>
<td>
</td>
</tr>
</table>';
I want to write the following statement inside the variable :
include_once('./folder/file.php');
I try to write it like the following but it failed:
$txt = '<table>
<tr>
<td>';
include_once('./folder/file.php');
$txt.='</td>
</tr>
</table>';
And I try it like that and also not work:
$txt = '<table>
<tr>
<td>
{include_once('./folder/file.php');}
</td>
</tr>
</table>';
How can I do that? I am sorry not very expert with mixing php and html so a small help will be appreciated ??
include_onceis probably not correct in this case since you're doing templating. Use the non-once variantinclude.