Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/250.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在php中,当值较大时,输入类型hidden dosent hide in form_Php_Html_Codeigniter - Fatal编程技术网

在php中,当值较大时,输入类型hidden dosent hide in form

在php中,当值较大时,输入类型hidden dosent hide in form,php,html,codeigniter,Php,Html,Codeigniter,我试图将隐藏的输入字段值设置为从数组中获取的xml字符串。 但是hidden字段值显示在html中,而当我将普通文本作为值放入隐藏字段时,它工作正常 //a large sized associative array convert to xml and set as hidden field $item_array=array(); $xml=new SimpleXMLElement('<OriginDestinationOption/&

我试图将隐藏的输入字段值设置为从数组中获取的xml字符串。 但是
hidden
字段值显示在
html
中,而当我将普通文本作为值放入隐藏字段时,它工作正常

//a large sized associative array convert to xml and set as hidden field 
            $item_array=array();
            $xml=new SimpleXMLElement('<OriginDestinationOption/>');
            array_walk_recursive($item_array,array($xml,'addChild')); 
           echo '<input type="hidden" name="return-xml" value="'.$xml->asXML();.'" />'; ?>
//大型关联数组转换为xml并设置为隐藏字段
$item_array=array();
$xml=新的SimpleXMLElement(“”);
数组\遍历\递归($item\数组,数组($xml,'addChild');
回音“”;?>
但它以html格式显示值。我的代码有什么问题


注意:我正在使用codeigniter framewrok

数据将溢出输入。尝试将css作为“溢出:隐藏”添加到输入中

 echo '<input type="hidden" style="display:none;" name="return-xml" value="'.str_replace('"',"'",$xml->asXML());.'" />'; ?>
echo';?>

您的值也可能包含双引号,但不应
回显“”;?>be
回音“”?>
?删除
asXML()
处的分号。您的值也可能包含双引号检查“$xml->asXML();”值内的引号。