"\n"
and "\r\n"
, tested in text message sent by telegram bot, to create line break. Instead of showing line break, underline _
will appear after using them.
How I could printing line feed in telegram message sent by bot?
CODE
$txt = 'با تشکر از عضویت شما، هر روز حدود ساعت 10 شب یک ویدئوی جالب برای شما ارسال خواهد شد.';
$txt .= " \n ";
$txt .= 'Thanks for joining, Every day at almost 18:30 GMT an intersting video will be sent';
Any help will be appreciated.
To avoid coding and encoding issues, I used this simple solution in my code:
Then, I insert the following code for each line break:
<pre>\n</pre>
ie.
Of course the text variable was curl escaped before appended to the URL:
1) If you develop your code in Windows/Linux OS, you can simply use enter in text:
Thats all!
2) If your code run on Windows/Linux server, you can use
PHP_EOL
constant instead of\n
:3) And if you search for an OS independent soloution, you can use
%0A
orchr(10)
for this purpose:for me this solution works: use double quotation mark