且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

PHP:电报机器人:在文本消息中插入换行符

更新时间:2023-11-19 12:35:04

有更好的方法!问题是由于URL编码... 您可以使用\n使用普通的PHP文本,但可以将其传递给urlencode方法,如下所示:

There is a better way! The problem is because of URL encodings... You can use normal PHP text using \n but by passing it to urlencode method, as follows:

$txt = urlencode("here is my text.\n and this is a new line \n another new line");

对我有用!