如何将php短标签转换为完整标签 [英] How do i convert php short tag to full one

查看:135
本文介绍了如何将php短标签转换为完整标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要编辑另一个在他的脚本中到处使用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.

那哪种方法更好呢?

  1. 要转换所有短标签吗?

  1. 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短标签转换为完整标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆