How to activate short tag usage in PHP ?

First of all, let's look that is it active?

if (ini_get('short_open_tag')){
    echo 'activate';
} else {
    echo 'not';
}

If it is congratulations you have done already :) If it is not we need to find php.ini file for this setting. To do this write this code on a php file and run, in results if you search it as php.ini you will find the path of the file.
 

<?php

phpinfo();

to edit fie open it and search the short_open_tag and change value with 10 and save it. Reboot the apache.

Then if you try the first code you will see that it is active. Now you may use the short way or long way.

<?php echo "phpExample.Net" ?>
<?="phpExample.Net"?>

 

Comments

There are no comments, make the firs comment