如何在PHP中设置短标签(< ;?)?

问题描述:

我正在将WAMPP用于PHP服务器,并且在编程短标签时使用会产生问题.我知道可以通过更改php.ini文件中的内容来实现,但是我不知道该设置如何,请为此提供帮助.

I am using WAMPP for PHP server and in programming short tag use create a problem. I knew that it possible by change something in php.ini file but I don't know the setting for that please help me for that.

示例:

<? echo "hi"; ?> //error....want to allow this also.
<?php echo "hi"; ?> //ok


我在PHP配置设置文件中找到了这个,但是我不知道需要什么更改...


I found this in PHP config setting file but what changes require I don't know...

; short_open_tag
;   Default Value: On
;   Development Value: Off
;   Production Value: Off

在您的php.ini中,将short_open_tag = Off更改为:

In your php.ini change the short_open_tag = Off if it's there to this:

short_open_tag = On