PHP: using a shorter tag will not work

I read the book “PHP for Absolute Beginners,” and I got to the part that says this world of php code is:

<?='Weird'?>

gives the text inside quotation marks.

But this does not apply to me, and I am not sure why.

Does anyone know a problem?

I am using Apache / mySQL (XAMPP) and Eclipse.

+3
source share
4 answers

There is a server version for enabling or disabling short tags. http://php.net/manual/en/ini.core.php

Tag

short_open_tag and is located in the php.ini file

+7
source

It is recommended that you do not use short tags. :)

They are usually disabled.

+1
source

<?= ... ?> <?php echo ... ?>. , short_open_tag ini ( <? ... ?> <?php ... ?>. script, ini_set.

+1

Please open php.ini and change short_open_tag to.

0
source

Source: https://habr.com/ru/post/1762386/


All Articles