tags:

views:

72

answers:

3

this is my php code:

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

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

+6  A: 

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

Gareth
Indeed, link in manual: http://www.php.net/manual/en/ini.core.php#ini.short-open-tag
Wrikken
Long tags look like this: <?php echo "World";?>
fd
A: 

You need to set short_open_tag to 1

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

quantumSoup
A: 

Does your file end in .php and will it execute as php on your webserver? add

<?php echo "yes I run php!<br>\n"; ?>

to your file to be sure. View source to see what happened to the php tags. Then maybe switch on short tags as the other answers told you to.

mvds