Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP: using shorter tag won't work

Tags:

php

I'm reading the book "PHP for absolute beginners" and I got to the part which says that this peace of php code:

<?='Weird'?>

yields the text inside quotes.

But this isn't the case for me and I'm not sure why.

Anyone knows the problem?

I'm using Apache/mySQL (XAMPP) and Eclipse.

like image 266
Tool Avatar asked Jun 02 '26 16:06

Tool


2 Answers

There is a server config to enable or disable short tags. http://php.net/manual/en/ini.core.php

tag is short_open_tag and is located in the php.ini file

like image 108
David Young Avatar answered Jun 05 '26 05:06

David Young


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

They're usually disabled.

like image 24
Xorlev Avatar answered Jun 05 '26 06:06

Xorlev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!