我想用这样的属性创建soapVars:
<tag attr="xxx">yyy</tag>
Run Code Online (Sandbox Code Playgroud)
这是否可以使用SoapVar构造函数,但不使用XSD_ANYXML和原始xml字符串?
最好的方法是:
<?php
$tag['_'] = 'yyy';
$tag['attr'] = 'xxx';
$tagVar = new SoapVar($tag, SOAP_ENC_OBJECT);
?>
Run Code Online (Sandbox Code Playgroud)
结果将是:
<tag attr="xxx">yyy</tag>
Run Code Online (Sandbox Code Playgroud)