<? ?> vs. <?php ?>

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
trassalg
Forum Newbie
Posts: 23
Joined: Fri Jul 27, 2007 3:26 pm

<? ?> vs. <?php ?>

Post by trassalg »

Is there any difference between using one set of tags or the other, or do they do the same thing? I'm wondering if they're slightly different in the say single and double quotes differ.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

<? ?> are called short tags, and are dependant on the short tags options being enabled in your php.ini (which isn't always the case). It is best always to use <?php ?> tags.

..oh ya short tags will be deprecated in php6
Post Reply