是否有一个工具可以像 Resharper
一样用于 C#,但适用于 Windows 平台的 HTML/PHP?我经常将一些大块代码从 CMS 复制到记事本,但这些代码通常未格式化或格式非常糟糕,因此很难阅读。希望有一些 Resharper CleanUp 功能,可以正确格式化它,以便于使用/阅读文档。
格式化前的示例:
<p>
<a class="hov" href="index.php?option=com_content&view=article&id=15&Itemid=16"><img alt="" src="files/images/buttons/btn_kalkulator1.gif" style="width: 272px; height: 235px;" /></a><a class="hov" href="index.php?option=com_content&view=article&id=10&Itemid=15"><img alt="" src="files/images/buttons/btn_kalkulator2.gif" style="width: 272px; height: 235px;" /></a></p>
格式化后的示例
<p>
<a class="hov" href="index.php?option=com_content&view=article&id=15&Itemid=16">
<img alt="" src="files/images/buttons/btn_kalkulator1.gif" style="width: 272px; height: 235px;" />
</a>
<a class="hov" href="index.php?option=com_content&view=article&id=10&Itemid=15">
<img alt="" src="files/images/buttons/btn_kalkulator2.gif" style="width: 272px; height: 235px;" />
</a>
</p>
最佳答案
我使用 JetBrains PHPStorm IDE - PHP、JS、HTML 的大量格式设置;快速重新格式化和其他非常有用的东西,确实让生活变得更轻松。我建议你尝试一下。
关于php - Windows 平台上 HTML/PHP 的代码清理/格式化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7419957/