Enabling some unfurnished code in php

Hi There,

I am new in php, and I got some code to be work on…

Now that person coded something like that


<?
//php code

?>
//for Printing
<?=?>

When I run this to my localhost, it does not recognize these type of coding until i do <?php ?> and <?php echo ?>

Please let me know how to enable this in my WAMPSERVER php INI…

Thanks in advance
Danish’

Hi Danish,

In your php.ini file, search for short_open_tag and make sure it’s enabled:

short_open_tag = On

I’ve always avoided using short tags in my code, as you can’t guarantee that they will be enabled in every environment where your code is run, but apparently the short echo tag (<?= ?>) is permanently enabled from PHP 5.4 onwards.

Edit: Don’t forget to restart Wamp server after editing php.ini.