How to pass an array into a PHP SoapClient call

后端 未结 6 1941
[愿得一人]
[愿得一人] 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 20:10

    'stay' has to be defined just once. This should be the right answer:

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

提交回复
热议问题