What is the difference? Any.. besides that one has the word "php" in it?
Difference between <?php ?> and <? ?>
Collapse
X
-
Heya, hdogg.
Short tags are supported because ASP Users are used to '<%' and '%>'. You can also use '<?=' as a shortcut for '<?php echo '.
As a general rule, I like to avoid short tags because they interfere with XML declarations ('<?xml').
Using short tags also tends to encourage combining HTML and PHP together, which I don't generally agree with; I feel very strongly that it is important to keep your display code separate from your op code (http://en.wikipedia.org/wiki/Model-view-controller).Comment
-
It is also generally not good practice to use short tags as they are turned off by default (PHP5) which will create problems if you move your code to another machine or if your code is used by someone who does not know the difference.
And as pbmods said, they encurage inlining PHP code with HTML markup which generally makes code ugly and hard to read.Comment
Comment