0

Possible Duplicate:
What does <?= mean?
Reference - What does this symbol mean in PHP?

Does anyone know what <? means? It is different from the usual php I am used to seeing and am in the midst of debugging a file so I wanted to know more about it but was not able to get any hits on the web.

Community
  • 1
  • 1
cpowel2
  • 575
  • 1
  • 10
  • 19

5 Answers5

3

It means the same as <?php, but only when short tags are turned on.

Quentin
  • 800,325
  • 104
  • 1,079
  • 1,205
2

It's the short open tag. There is a setting in the configuration that turns it on or off, so it's not recommended to be used.

Niet the Dark Absol
  • 301,028
  • 70
  • 427
  • 540
1

it is a shorthand script tag, but there is a server configuration setting for it, so you should not use it if you plan on having your scripts be deployed, because some people may not have that setting enabled and not understand to do it.

Crayon Violent
  • 30,524
  • 3
  • 51
  • 74
1

that's the short php opening tag, you can use

<? //CODE HERE ?>,

`<?PHP //CODE HERE ?> 

or to display the info you can use

`<?= //CODE HERE ?>`

To use the Short tag you need to set up in the config file

you can take a look here:

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

Tells PHP whether the short form () of PHP's open tag should be allowed. If you want to use PHP in combination with XML, you can disable this option in order to use inline. Otherwise, you can print it with PHP, for example: '; ?>. Also, if disabled, you must use the long form of the PHP open tag ().

Note:

This directive also affected the shorthand <?= before PHP 5.4.0, which is identical to <? echo. Use of this shortcut required short_open_tag to be on. Since PHP 5.4.0, <?= is always available. 


Name         Default    Changeable      Changelog
short_open_tag  "1"     PHP_INI_ALL     PHP_INI_ALL in PHP 4.0.0. PHP_INI_PERDIR in PHP < 5.3.0
jcho360
  • 3,665
  • 1
  • 12
  • 23
0

It's the equivalent of <?php, but it should never be used. Only Chuck Norris can use short tags...

VettelS
  • 1,200
  • 1
  • 8
  • 17