PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?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); echo $res;
Show:  
Copy Clear