次のようなhtml構造を含む変数があります。
$txt = '<table>
<tr>
<td>
</td>
</tr>
</table>';
変数内に次のステートメントを書きたい:
include_once('./folder/file.php');
次のように書き込もうとしましたが、失敗しました。
$txt = '<table>
<tr>
<td>';
include_once('./folder/file.php');
$txt.='</td>
</tr>
</table>';
そして、私はそのように試してみましたが、うまくいきません:
$txt = '<table>
<tr>
<td>
{include_once('./folder/file.php');}
</td>
</tr>
</table>';
どうやってやるの?申し訳ありませんが、php と html の混合の専門家ではないので、小さな助けをいただければ幸いです ??