如何在电报信息中生成新的行字符? [英] How to generate new line character in telegram message?

查看:97
本文介绍了如何在电报信息中生成新的行字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将从mysql数据库读取的数据发送给电报用户时,用户会使用下划线等而不是新行字符。所以这样我就无法正确格式化消息文本。



如何格式化一个有4个或更多可能答案的问题的电报信息?



我还没想到还会改变什么呢?顺便说一句,我发送的是非英文字符。

When I send the data I read from mysql database to telegram user, the user gets underline and etc instead of new line character. So this way I can't format message text correctly.

How can I format a telegram message that is a question with 4 or more possible answers?

What else is going to be changed that I don't expect? By the way I'm sending non-english characters.

$qsBody = $rowQuestion['body']; // This is what I read from database that contains some new line characters
$strReply = $qsBody;
$strSendMethod = "SendMessage?chat_id=$ChatId&text='$strReply'";
file_get_contents( BOT_TARGET_ADDRESS . $strSendMethod );
// The message received by user contains _ instead of new line.

推荐答案

qsBody =
qsBody =


rowQuestion [' body']; // 这是我从包含一些新行字符的数据库中读取的内容
rowQuestion['body']; // This is what I read from database that contains some new line characters


strReply =
strReply =


这篇关于如何在电报信息中生成新的行字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆