gpt4 book ai didi

php - 如何向 soapVars 添加属性

转载 作者:可可西里 更新时间:2023-10-31 22:49:42 25 4
gpt4 key购买 nike

我想创建具有如下属性的 soapVars:

<tag attr="xxx">yyy</tag>

这是否可以通过 SoapVar 构造函数实现,但使用 XSD_ANYXML 和原始 xml 字符串?

最佳答案

最好的方法是:

<?php 
$tag['_'] = 'yyy';
$tag['attr'] = 'xxx';
$tagVar = new SoapVar($tag, SOAP_ENC_OBJECT);

?>

结果是:

<tag attr="xxx">yyy</tag>

关于php - 如何向 soapVars 添加属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2257973/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com