PHP banner

Another post from the archives: I am running a WAMP development environment at home and at work. I am always looking for new ways to fine-tune my set-up. Here is one…

The short open tags option allow you to leave off the “php” in the opening tag of your code block. So, instead of:

    // your code

you use:

    // your code

To enable PHP short style tags, you will need to edit your php.ini file.

  1. Open 
  2. Search for short_open_tag
  3. Set it to = On (it is Off by default)
  4. Save the file
  5. Restart your web server

The advantage: you get to save yourself typing 3 characters for every PHP code block you write.

The disadvantages: loss of portability: your code will not work on a server where short tags have not been enabled — and many ISP’s are not willing to edit the php.ini file on the server.

Also, note that as of PHP 5.4.0 <?= will always work, regardless of your short_open_tag setting, e.g.:



By foxbeefly

PHP / MySQL Developer. HTML, CSS and some JavaScript.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.