我多年来一直在处理这个问题,但是我从来没有调查过它。但我一直在想。
在PHP模板中,如果我运行它:
<p>
<?php echo 'Between "?>" and "</p>" is one linebreak.'; ?>
</p>
<p>
<?php echo 'Between "?>" and "</p>" is one space, then one linebreak.'; ?>
</p>
<p>
<?php echo 'Between "?>" and "</p>" is two linebreaks.'; ?>
</p>
这是输出:
<p>
Between "?>" and "</p>" is one linebreak.</p>
<p>
Between "?>" and "</p>" is one space, then one linebreak.
</p>
<p>
Between "?>" and "</p>" is two linebreaks.
</p>
我不明白这种行为。为什么忽略单个换行符就好像它不存在(如第一个例子中那样)?