如何查找php开始标志<;?还是<;?php

如何查找php开始标志<;?还是<;?php,php,Php,使用php是否可以确定php.ini中的short start标志是否在最新的php版本中始终有效 您可以使用ini\u get()检索它的值,但不能使用ini\u set更改它。不过,您可以使用一个.htaccess来设置它,该.htaccess在上包含php\u flag short\u open\u标记 因此,您不应该在php.ini中使用,因为在最新的php版本中始终有效 您可以使用ini\u get()检索它的值,但不能使用ini\u set更改它。不过,您可以使用一个.htacces

使用php是否可以确定php.ini中的short start标志
是否在最新的php版本中始终有效

您可以使用
ini\u get()
检索它的值,但不能使用
ini\u set
更改它。不过,您可以使用一个.htaccess来设置它,该.htaccess在
上包含
php\u flag short\u open\u标记

因此,您不应该在php.ini中使用
,因为
在最新的php版本中始终有效

您可以使用
ini\u get()
检索它的值,但不能使用
ini\u set
更改它。不过,您可以使用一个.htaccess来设置它,该.htaccess在
上包含
php\u flag short\u open\u标记


因此,永远不要使用
是的,有一个ini变量,它被称为
short\u open\u tags
。因此,只需将
ini\u get
sort\u open\u tags
放在一起,因为如果服务器上有短标记,参数应返回
true

ini_get('short_open_tag')

是的,有一个ini变量,它被称为
short\u open\u tags
。因此,只需将
ini\u get
sort\u open\u tags
放在一起,因为如果服务器上有短标记,参数应返回
true

ini_get('short_open_tag')

我现在仔细检查了一下:

<?php
check_configuration(); // on a blank linux install check for some config flags
function check_configuration(){
    $test_short_open_tag=false;
    ?><? $test_short_open_tag=true; ?><?php
    if(!ini_get('short_open_tag') or !$test_short_open_tag){
       die( '<br>ERROR: please allow \'short_open_tag\' in php.ini or .htaccess to allow the use of "&lt;?"<br><br>'); 
    }
}

我现在仔细检查了一下:

<?php
check_configuration(); // on a blank linux install check for some config flags
function check_configuration(){
    $test_short_open_tag=false;
    ?><? $test_short_open_tag=true; ?><?php
    if(!ini_get('short_open_tag') or !$test_short_open_tag){
       die( '<br>ERROR: please allow \'short_open_tag\' in php.ini or .htaccess to allow the use of "&lt;?"<br><br>'); 
    }
}

你可以使用
ini\u get
来找出答案,但是你打算怎么做呢?为了执行
ini\u-get
您必须在PHP代码中,这意味着您必须使用长格式以确保安全。您可以使用
ini\u-get
找到答案,但您将如何处理?为了执行
ini\u get
,您必须在PHP代码中,这意味着您必须使用长表单以确保安全。