我正在尝试向我的电报机器人发送消息。确切地说,名称变量不允许我这样做。
$arr = array(
$phoneFieldset => $phone,
$nameFieldset => $name,
$messageFieldset => $message,
);
foreach($arr as $key => $value) {
$txt .= "<b>".$key."</b> ".$value."%0A";
};
$request = "https://api.telegram.org/bot{$token}/sendMessage?chat_id={$chat_id}&parse_mode=html&text={$txt}";
echo $request;
$sendToTelegram = fopen($request,"r");
当脚本失败时,请求回显输出:
https://api.telegram.org/botMYTOKEN/sendMessage?chat_id=-449128489&parse_mode=html&text=Телефон: 123%0AИмя: de%0AСообщение: 123213%0A
警告:fopen(https://api.telegram.org/botMYTOKEN/sendMessage?chat_id=-449128489&parse_mode=html&text=Телефон: 123%0AИмя: de%0AСообщение: 123213%0A): 无法打开流: HTTP 请求失败!HTTP/1.1 400 错误请求在 C:\nginx\html\scripts\php\send-message-to-telegram.php 上行 61 Ошибка.Сообщение не отправлено!
第 61 行是包含 .fopen()
当脚本工作时,请求回显输出:
https://api.telegram.org/botMYTOKEN/sendMessage?chat_id=-449128489&parse_mode=html&text=Телефон: 123123%0AСообщение: 1213123%0A
PIPIONE
PHP Warning: fopen(F:\demo\text.txt): failed to open stream: No such file or directory in index.php on line 3
getimagesize(1.jpg): failed to open stream: No such file or directory
/ClFrame/IDatabase.php): failed to open stream: No such file or directory in D:\CLFrame\ClFrame\Loader.php on line 15报错是怎么回事
出现警告的问题Warning: copy(D:\wamp\tmp\php415C.tmp): failed to open stream: No such file or directory in