I’m sending some data through xml code, problem is that in xml I want to send multiple with some data in it (It depends on product items quantity) have no idea what to do.
$number_array = $_POST['numbers'];
$name_array = $_POST['name'];
$quantity_array = $_POST['quantity'];
$price_array = $_POST['totprice'];
$output1 = ''.implode(' ', $number_array).' ';
echo $output1;
$output2 = ''.implode(' ', $name_array).' ';
echo $output2;
$output3 = ''.implode(' ', $quantity_array).' ';
echo $output3;
$output4 = ''.implode(' ', $price_array).' ';
echo $output4;
for ($i = 0; $i < count($name_array); $i++) {
$name = ($name_array[$i]);
$number = ($number_array[$i]);
$quantity = ($quantity_array[$i]);
$price = ($price_array[$i]);
}
$xml = '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<save_waybill xmlns="http://tempuri.org/">
<su>username</su>
<sp>password</sp>
<waybill>
<WAYBILL>
<SUB_WAYBILLS></SUB_WAYBILLS>
<GOODS_LIST>
I need this are to be same quantity as I submit products in above code (array)
<GOODS>
<ID>0</ID>
<W_NAME>Name1</W_NAME>
<UNIT_ID>1</UNIT_ID>
<UNIT_TXT></UNIT_TXT>
<QUANTITY>1</QUANTITY>
<PRICE>100</PRICE>
<STATUS>1</STATUS>
<AMOUNT>2</AMOUNT>
<BAR_CODE>123</BAR_CODE>
<A_ID>0</A_ID>
<VAT_TYPE>0</VAT_TYPE>
</GOODS>