PHP的short_open_tag问题 [英] php short_open_tag problem

查看:64
本文介绍了PHP的short_open_tag问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在大学的一个项目上工作,但是我的大学服务器管理员告诉我,我们在代码中不使用short_open_tag是什么意思?什么是短开放标签及其替代

hi i am working on a project of my college but my college server admin told me that we don’t use short_open_tag in our code what’s its mean? what is short open tag and what is alternate of it

谢谢

推荐答案

通常,您像这样编写PHP:<?php PHP CODE HERE ?>.但是,如果启用了 allow_short_tags 指令,则可以使用:<? PHP CODE HERE ?>.另外,sort标签还提供了额外的语法:<?= $var ?>等于<?php echo $var ?>.

Normally you write PHP like so: <?php PHP CODE HERE ?>. However if allow_short_tags directive is enabled you're able to use: <? PHP CODE HERE ?>. Also sort tags provides extra syntax: <?= $var ?> which is equal to <?php echo $var ?>.

短标签似乎很酷,但事实并非如此.它们只会引起更多的问题.哦,还有IIRC,它们将从PHP6中删除.

Short tags might seem cool but they're not. They causes only more problems. Oh... and IIRC they'll be removed from PHP6.

这篇关于PHP的short_open_tag问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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