有没有办法在php关闭标签后强制换行?>什么时候嵌入html?
I have been searching online with little success for a way to force php to output a newline after a closing php tag ?>
so that my HTML will be rendered as I see it before its parsed by PHP so that it will look neat and tidy when viewing the html source code for a page.
我一直在网上搜索没有成功的方法强制php在关闭php标签后输出换行符?>这样我的HTML将在PHP解析之前呈现,以便它看起来整洁有序查看页面的html源代码。
I want to stop it from removing the newline and causing the next line from wrapping up and therefore ruining the format of the page. Is there a specific php.ini
setting I can change to disable this behaviour?
我想阻止它删除换行符并导致下一行换行,从而破坏了页面的格式。是否有特定的php.ini设置我可以更改以禁用此行为?
All my code logic files have ?>
removed from the end of them so I wont need to worry about them injecting extra newlines which is why I believe PHP was coded to strip the trailing new lines.
我的所有代码逻辑文件都从它们的末尾删除了所以我不需要担心它们注入额外的换行符,这就是为什么我认为PHP被编码为剥离尾随的新行。
7 个解决方案
#1
15
Richard is saying this:
理查德这样说:
Hello <? ?>
Jello
...after PHP-parsing becomes this:
... PHP解析后成为:
Hello Jello
I just add an extra newline manually, like this:
我只是手动添加一个额外的换行符,如下所示:
Hello <? ?>
Jello
...giving this:
Hello
Jello
更多相关文章
- 使用GMail SMTP服务器从PHP页面发送电子邮件
- php 获取当前页面url路径
- 如何在jQuery Mobile页面中提交表单?
- php如何跨站抓取别的站点的页面的补充
- php下删除一篇文章生成的多个静态页面
- 如何在刷新页面时停止“Conform form resubmission”对话框
- wordpress永久链接重新加载页面,而不是重定向到发布
- 在返回按钮上重新加载页面。
- ajax在php页面上获得一个值的结果