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

更多相关文章

  1. 使用GMail SMTP服务器从PHP页面发送电子邮件
  2. php 获取当前页面url路径
  3. 如何在jQuery Mobile页面中提交表单?
  4. php如何跨站抓取别的站点的页面的补充
  5. php下删除一篇文章生成的多个静态页面
  6. 如何在刷新页面时停止“Conform form resubmission”对话框
  7. wordpress永久链接重新加载页面,而不是重定向到发布
  8. 在返回按钮上重新加载页面。
  9. ajax在php页面上获得一个值的结果

随机推荐

  1. android:gravity="start" Android 多行文
  2. ANDROID音频系统散记之一:A2dpAudioInterf
  3. android 每周学习笔记及总结(每周更新)
  4. Android 中 WebView 使用漏洞相关介绍
  5. Dagger 2 在 Android 上的使用(一)
  6. android遇到的BUG
  7. 什么是android(What Is Android?)
  8. Android(安卓)JNI入门第五篇——基本数据
  9. Android AIDL 跨进程服务 Proxy/Stub
  10. Android如何获取多媒体文件信息