How to pass an array into a PHP SoapClient call

后端 未结 6 1944
[愿得一人]
[愿得一人] 2020-12-05 19:33

Using PHP and SoapClient.

I need to pass the following XML into a soap request - i.e. multiple \'s within .

<
6条回答
  •  粉色の甜心
    2020-12-05 19:50

    I had similar problem and I had to post data in this structure. Accepted answer didn't work for me

    $xml = array('reservation' => array(
        'stays' => array(
            array(
                'start_date' => '2011-01-01',
                'end_date'   => 2011-01-15
            ),
            array(
                'start_date' => '2011-01-01',
                'end_date'   => 2011-01-15
            )
        )
    ));
    

    maybe it might help somebody if accepted answear doesn't work for you

    + minor tip for all of you, use $xml = ['key' => 'val']; instead of $xml = array('key' => 'val');

提交回复
热议问题