Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/14.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中的多数组_Php_Arrays_Xml_Web Services_Xsd - Fatal编程技术网

php中的多数组

php中的多数组,php,arrays,xml,web-services,xsd,Php,Arrays,Xml,Web Services,Xsd,我只有php的初学者技能, 我需要得到几个人的信息姓名和姓氏,目前我只得到一个 下面描述的问题更准确: 当前php代码片段: myRegister($server,'info',array( 'in' => array('id_code' => 'xsd:int'), 'out' => array( 'name' => 'xsd:string', 'surname'=>'xsd:string', ))); 当前结果: <Response>

我只有php的初学者技能,
我需要得到几个人的信息
姓名
姓氏
,目前我只得到一个

下面描述的问题更准确:
当前php代码片段:

myRegister($server,'info',array(
'in' => array('id_code' => 'xsd:int'),
'out' => array(
    'name' => 'xsd:string', 
'surname'=>'xsd:string', )));
当前结果:

<Response>
    <name>Name</name>
    <surname>Surname</surname>
</Response>

名字
姓
我需要的是:

<Response>
    <person>
       <name>Name</name>
       <surname>Surname</surname>
    </person>
</Response>

名字
姓
如何编写php多数组?用php?正如我在本例中看到的,我可以接待几个人

你能试试这个吗

    myRegister($server,'info',array(
'in' => array('id_code' => 'xsd:int'),
'out' => array('person' => array(
    'name' => 'xsd:string', 
'surname'=>'xsd:string', ))));
我不是专家,也许这能帮上忙

array( 'person' => 
   array( 
      array( 'name' => 'john', 'surname' => 'smith' ),
      array( 'name' => 'jack', 'surname' => 'black' ),
      ...
   )
);
在php中,非关联数组不能像xml中那样具有命名节点,因此“person”数组myst的每个元素都可以转换为一个节点。据我所知(如果我错了,请纠正我),这只能通过自定义功能来完成。

它能这样工作吗?姓名“姓名”