问题描述
我要编辑另一个在他的脚本中到处使用php short标签的家伙的项目.我的服务器中禁用了短标签.我认为转换所有短标签而不是在服务器中启用短标签是更好的选择.
I am to edit a project of another guy who used php short tag everywhere in his script. I have short tag disabled in my server. I think converting all the short tags instead of enabling short tag in my server is the better one.
那哪种方法更好呢?
-
要转换所有短标签吗?
Converting All short tag?
在服务器中启用短标签?
Enabling short tag in my server?
如何将所有短标签批量转换为完整标签
How do i convert all short tag to full one in batch
推荐答案
可以使用 http://php.net/manual/en/function.token-get-all.php .与find& replace不同,这不会影响XML声明等.转换与启用ST:取决于.许多程序员可能更喜欢<?php而不是<?,因此在进行转换时,您的代码将更加标准".但是, https://meta.stackoverflow.com/of 标准"方式的重要性取决于情况.
Converting can be written using http://php.net/manual/en/function.token-get-all.php . Unlike find&replace, this does not affect XML declarations and so on.Converting vs. enabling ST: It depends. Many programmers probably prefers <?php to <?, so when you convert, you code will be more "standard". However, the importancy https://meta.stackoverflow.com/of "standard"-way depends on the situation.
这篇关于如何将php短标签转换为完整标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!