By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,191 Members | 1,064 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,191 IT Pros & Developers. It's quick & easy.

Difference between <?php ?> and <? ?>

P: 78
anybody can pls tell me what is the difference between using <?php ...?> and <?...?> tags in php
Dec 7 '11 #1
Share this Question
Share on Google+
2 Replies

P: 1,059
<?...?> is called short tag. If you use short tag you would be able to write php code in short tag. it also can used in HTML TAG. as example
Expand|Select|Wrap|Line Numbers
  1. <INPUT TYPE='text' value=<?=$value?>>
But If you want to use a combination of other non php tag it would conflict such as
<?xml ?>

but you can achieve it anyway
Dec 7 '11 #2

P: 170
To expand on Johny's comment, some servers (Mainly apache) will initiate a PHP code block when <? ?> is used, however, Windows-based servers require <?php ?> tags.
Dec 8 '11 #3

Post your reply

Sign in to post your reply or Sign up for a free account.