$a = [
[
'name' => 'Название 1',
'price' => 140,
],
[
'name' => 'Название 2',
'price' => 140,
]
];
$b = [2, 10];
$result = array_map(fn($item, $qty) => $item + ['quantity' => $qty], $a, $b);
$result = array_map(function ($item, $qty) {
return $item + ['quantity' => $qty];
}, $a, $b);
$url = $apiURL. "sendPhoto?chat_id=" . $chatID";
$post_fields = array('chat_id' => $chatID,
'caption' => 'Подпись под картинкой',
'photo' => new CURLFile(realpath('/img/1.png'))
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type:multipart/form-data"
));
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
$output = curl_exec($ch);