Using SOAP to generate XML attributes in PHP

php, soap

Solution

I don't have a quick way of testing, but maybe this would work:

$a = array(
    'foo' => array(
        'bar' => 'blah',
        'aaa' => array(
            '_' => 'blah',
            'a' => "b",
        ),
    ),  
);

Problem

I found you can generate this in SOAP in php: ``` <foo bar="blah">12345</foo> ``` With this: ``` array("foo" => array("_" => 12345, "bar" => "blah")); ``` However, the underscore method does not seem to work when the value is not a number and string, but instead embedded xml code. How would you do this for instance? ``` <foo bar="blah"> <aaa a="b">blah</aaa> </foo> ``` This is an extension of this person's question: http://www.bigresource.com/Tracker/Track-php-uQwDoUib/

Original source