PHPのみのファイルを書く場合は、閉じタグは書かない方がバグが起きにくいらしいです。
参考→https://www.php.net/manual/ja/language.basic-syntax.phptags.php
htmlに挿入する場合は必要になります。
また、echoの場合も省略する書き方があるようです。
example.php
<?php echo 'text'; ?>
<?= 'text'; ?>
//どちらも同じ動きをする
Go to list of users who liked
More than 3 years have passed since last update.
PHPのみのファイルを書く場合は、閉じタグは書かない方がバグが起きにくいらしいです。
参考→https://www.php.net/manual/ja/language.basic-syntax.phptags.php
htmlに挿入する場合は必要になります。
また、echoの場合も省略する書き方があるようです。
<?php echo 'text'; ?>
<?= 'text'; ?>
//どちらも同じ動きをする
Register as a new user and use Qiita more conveniently
Go to list of users who liked