M
M
Murka Murenich2017-09-13 14:43:41
PHP
Murka Murenich, 2017-09-13 14:43:41

How to make different pictures each time on one request in callback api?

How can I make the bot send a different picture each time in the community messages when the request is the same?
That is, prescribe a lot of different pictures and each time gave a random one.
The code:

}elseif (strpos($user_msg, 'girl') !== false) { 
     $v->msgsend("Держи тяночку", $uid, $token,  "photo-153335667_456239040");

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya Gerasimov, 2017-09-13
@drobysevdanila

$images = ['photo1', 'photo2', 'photo3', 'photo4']
$image = $images[array_rand($images)]

R
Rsa97, 2017-09-13
@Rsa97

Write a lot of different pictures and each time give a random

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question