PHP适用于<?php?>而不是<? ?>

For some reason it seems to be working fine, only when I used <?php ?> tag. Does not work with <? ?>

What's wrong here?

Enable short_open_tag in php.ini or enable Php short open tags in php settings in wamp (In windows)...

There's a php.ini setting (short_open_tag: boolean, default: "1") to enable the use of <? ?>

Nothing's wrong. And RC quoted the wrong option.. it's short_open_tag that you're interested in. This is why people advise against using short tags, because you run into problems like this when you try switching servers.


Before you guys go and horribly miscontrue my "nothing's wrong" statement, I mean that it's not a bug or defect... you're just not using the correct settings.