php delimiters

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Excuse the newbie question.

I have seen different types of delimiters to note php code.

<?php and ?>
<? and ?>

However the code
<?= and ?>
is marked up by Dreamweaver as php delimiters. (ie not part of the code  
itself). I have noticed that the = is necessary sometimes but would like an  
explanation about its use.

Whats the difference between these codes? Are there any limitations on  
browser versions, platforms, or other user settings that favour either pair  
of delimiters.

Garry Jones

Re: php delimiters

Garry Jones wrote:
Quoted text here. Click to load it

This was discussed quite recently so rewind your news for the details,  
but in summary:

<?php and <? are equivalend if and only if short_open_tag is set to 'on'  
in the php.ini file.

Similarly, <?php echo and <?= are equivalent with the same restriction.

Use of the short tags can cause problems with XML parsers, application  
portability and the future direction of PHP, so get used to using the  
long forms. i.e. use <?php and <?php echo.


Site Timeline