PHP, MySQL, Drupal, .htaccess, Robots.txt, Phponwebsites: How to enable short tags in php using .htaccess

28 Nov 2013

How to enable short tags in php using .htaccess

                       Mostly you would use ' <?php echo $name; ?> ' tag for display anything you want. You can also display this type of single variable value by <?=$name?>. But sometime your browser doesn't take this tag. On that time, you won't get proper output. So you can be done this by .htaccess.

Syntax:
              php_value short_open_tag 1
                 
                      Now you can use short tag in your site.

It can also done by php.ini file. You've to change in php.ini file. In your php.ini file, find " short_open_tag=off", then change 'off ' to 'on'. Save the changes and restart your WAMP server.


Related Post:

4 comments:

  1. It is not strongly discouraged to use short tags ?

    ReplyDelete
    Replies
    1. You can use short tags in your file. Server support this short tags. You tried to use it in your local server, sometimes it is not supported. So you need to enable it.

      Delete
  2. Thank you... It is the nice method to display single variable in PHP.

    ReplyDelete
  3. Thank you.. New information to know in php

    ReplyDelete

Note: only a member of this blog may post a comment.