=?> PHP中的特殊标签
谁能解释一下 php 中这些特殊标签是什么?
<?= ?>
我在谷歌上找不到它。
can anybody please explain what are these special tags in php?
<?= ?>
I couldn't find it on google.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
请参阅 short_open_tags 设置。
与
并使用它需要打开
short_open_tag
。要搜索的术语是“短标签”。例如:
与
是
的缩写形式。
另请参阅 PHP 短标签可以使用吗? 此处。
See the short_open_tags setting.
<?=
is identical to<? echo
and use of it requiresshort_open_tag
to be on. A term to search for would be "short tags".As an example:
<?='hello'?>
is identical to<? echo 'hello' ?>
which is a short form of<?php echo 'hello' ?>
.See also Are PHP short tags acceptable to use? here on SO.
它是 short_open_tag 的一部分。基本上
相当于
It's part of the short_open_tag. Basically
<?=$foo?>
is equivalent to<?php echo $foo; ?>
他们直接输出里面的内容。
是以下内容的快捷方式:
这些(与
一起)称为短标签。 参见此处 (short_open_tag)
They output what's inside them directly.
is a shortcut for:
These (together with
<? ?>
) are called short tags. See here (short_open_tag)是
。
我不建议使用这些短标签,因为在某些网络服务器环境中它们是通过 PHP 配置禁用的。
<?= $foobar ?>
is a shortcut for<?php echo $foobar; ?>
.I wouldn't recommend using these short tags because in some webserver environments they are disabled via PHPs configuration.
是的,您可以使用 .htaccess 来完成。在您的 .htaccess 文件中添加此
现在您可以使用
而不是
检查文件>
yes you can done it using .htaccess. In your .htaccess file, add this
Now you can check files with
<?='hi';?>
instead of<?php ?>