2015-12-14 26 views
1

所以,我有2个PHP文件,index.phpinclude.php问题当使用短标签包含php文件

index.php

<?php 
include ('include.php'); 
?> 

include.php

<? 
$a = 1>0; 
echo "test"; 

当我运行index.php,我所得到的是

0; echo "test"; 

这种情况发生时的部份include.php是使用短开放标签,任何人都知道什么是问题?

我使用PHP 5.4.16

+0

你启用短标记? – chris85

+0

'short_open_tag =开' –

+1

如果您看到'0;回声“测试”;'这意味着'<? $ a = 1>'被解析为HTML。 –

回答

0

尝试在.htaccess中添加此

<IfModule mod_php5.c> 
    php_value short_open_tag 1 
</IfModule> 

或 设置在php.ini

short_open_tag = On