Answer the question
In order to leave comments, you need to log in
How to save php command value?
I use https://github.com/telegrambot/api
Code:
$bot->command('cc', function ($message) use ($bot) {
$f = #сообщение
$bot->sendMessage($message->getChat()->getId(), $f); #Отправка
});
Answer the question
In order to leave comments, you need to log in
If the problem is getting the part of the string after the first space, so below are a couple of solutions:
<?php
$mystring = "The new brave world!";
$delimiter = ' ';
echo explode($delimiter, $mystring, 2)[1];
echo PHP_EOL;
echo trim(strstr($mystring, $delimiter));
echo PHP_EOL;
echo substr($mystring, strpos($mystring, $delimiter)+1);
echo PHP_EOL;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question