short_open_tag = On
Is it possible?
EDIT
I tried this :
<?php
if (!ini_get('short_open_tag')) {
ini_set('short_open_tag', 'On');
}
$a=1;
?>
<?=$a;?>
which outputs <?=$a;?>
,so it's not working.
short_open_tag = On
Is it possible?
EDIT
I tried this :
<?php
if (!ini_get('short_open_tag')) {
ini_set('short_open_tag', 'On');
}
$a=1;
?>
<?=$a;?>
which outputs <?=$a;?>
,so it's not working.
Yes, ini_set()
is what you want.
EDIT: Added an example
if (!ini_get('short_open_tag')) {
ini_set('short_open_tag', 'on');
}
Although you can use ini_set, be careful (quoted from the PHP Documentation)
Not all the available options can be changed using ini_set(). There is a list of all available options in the appendix.
If you are changing options like magic_quotes, short_open_tags, that's OK. But if you are going to change safe_mode, enable_dl, etc. you might face certain problems.
if you want to change it during a session and forget about it later, use ini_get() and ini_set(). If you want to actually modify php.ini programmatically, you can parse the ini file using parse_ini_file, change your options and rewrite back to disk. See here for more
or you can write your own string replacement routine using the normal opening of file, preg_replace() etc..
If you are using PHP 5.3 short_open_tag
is no longer an option.
http://php.net/manual/en/ini.core.php
Short tags have been deprecated as of PHP 5.3 and may be removed in PHP 6.0.