<?php
ignore_user_abort(true);
set_time_limit(0);
foreach ($results as $result)
{
//получаем массив со списком статусов для заказа
$statushistory = array();
foreach($result->statushistory[0] as $child)
{
$attrsStatusHistory = $child->attributes();
$status = array(
'eventstore' => (string)$attrsStatusHistory['eventstore'],
'eventtime' => (string)$attrsStatusHistory['eventtime'],
'createtimegmt' => (string)$attrsStatusHistory['createtimegmt'],
'title' => (string)$attrsStatusHistory['title']
);
$statushistory[] = $status;
}
$order = array(
// ... код как у вас был
'statushistory' => $statushistory,
);
}
curl_file_create ( string $filename [, string $mimetype [, string $postname ]] ) : CURLFile