Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
$token = '6067338876:AAGXn8_AMCBRKPc1MN5vMHBwmPZJcbaa4Ns';
$item = 'image.jpg';
$arrayQuery = array(
'chat_id' => 885195715
);
$tm_el = array( 'type' => 'photo', 'media' => 'attach://'. $item );
$tm_arr[] = $tm_el;
$arrayQuery[] = array( 'media' => json_encode($tm_arr) );
$arrayQuery[] = array( $item => 'https://labrador.help/assets/resourceimages/357/646de209286ea3.33000200.jpg' );
var_dump($arrayQuery);
$ch = curl_init('https://api.telegram.org/bot'. $token .'/sendMediaGroup');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $arrayQuery);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
$res = curl_exec($ch);
curl_close($ch);