Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Question mark equals, doesn't work on php

Tags:

php

this is my php code:

<html><body>Hey!: <?= "World";?></body></html>

It just prints "Hey!:" Whats wrong with my code?

like image 981
telaviv Avatar asked Jul 18 '10 22:07

telaviv


2 Answers

Short tags (which you're using here) can be turned on or off depending on the server you're running the code on. If it's your server, look in php.ini

like image 63
Gareth Avatar answered Oct 19 '22 22:10

Gareth


You need to set short_open_tag to 1

http://php.net/manual/en/ini.core.php

like image 27
quantumSoup Avatar answered Oct 20 '22 00:10

quantumSoup