<?php 和 <? 之间的区别

2021-12-29 00:00:00 syntax php

我是 php 新手,想知道这些服务器标签之间是否有任何区别:

I am new to php and would like to know if there are any differences between these server tags :

<?php
?>

<?
?>

推荐答案

第一个是安全的打开和关闭标签变体,第二个是所谓的短开标签.第二个并不总是可用,如果可能,使用第一个选项.您可以在 php.ini 中的 short_open_tag 处检查短开放标签的可用性.

The first is a safe open and close tag variation, the second is the so called short-open tag. The second one is not always available, use the first option if it's possible. You could check the availability of short open tags in php.ini, at the short_open_tag.

相关文章