Php 更改htmlentities的默认报价样式
是否有方法(ini设置或其他)更改PHP的htmlenties函数的默认引号设置?我经常在数组映射中使用它,它不允许您提供额外的参数。试试这个 或Php 更改htmlentities的默认报价样式,php,Php,是否有方法(ini设置或其他)更改PHP的htmlenties函数的默认引号设置?我经常在数组映射中使用它,它不允许您提供额外的参数。试试这个 或 $r=array('afdsasdfasdf',''); 功能映射实体($str){ 返回htmlentities($str,ENT_报价); } $array=数组映射('map\u entities',$r); $r = array( 'afdsasdfasdf<>', '<test ="">' ); functio
$r=array('afdsasdfasdf','');
功能映射实体($str){
返回htmlentities($str,ENT_报价);
}
$array=数组映射('map\u entities',$r);
$r = array( 'afdsasdfasdf<>', '<test ="">' );
function map_entities( $str ) {
return htmlentities( $str, ENT_QUOTES );
}
$array = array_map ( 'map_entities', $r );