$array = [];
$multi_curl->error(function($instance) use (&$array) {
echo 'call to "' . $instance->url . '" was unsuccessful.' . "\n";
echo 'error code: ' . $instance->errorCode . "\n";
echo 'error message: ' . $instance->errorMessage . "\n";
$array[] = $instance->errorCode;
});
case 'name':
$merged[$orderId][$key] = (false === isset($merged[$orderId][$key])) ? sprintf("%s - %dшт. ", $item, $order['quantity']) : sprintf("%s *** %s - %dшт. ", $merged[$orderId][$key], $item, $order['quantity']);
break;
$merged = [];
foreach ($orders as $order) {
$orderId = $order['order_id'];
foreach ($order as $key => $item) {
switch ($key) {
case 'quantity':
case 'total':
$merged[$orderId][$key] = (false === isset($merged[$orderId][$key])) ? $item : $merged[$orderId][$key] + $item;
break;
case 'name':
$merged[$orderId][$key] = (false === isset($merged[$orderId][$key])) ? $item : $merged[$orderId][$key] . " *** " . $item;
break;
case 'price':
break;
default:
$merged[$orderId][$key] = $item;
break;
}
}
}