How to send new line whatsapp message using PHPJavaScript? - Stack Overflow

;text=Hello%0AHow%20R%20U?OP: I want this output using PHPJavaScript:HelloHow R U?I have a already t

;text=Hello%0AHow%20R%20U?

O/P:

I want this output using PHP/JavaScript:

Hello
How R U?

I have a already try encodeURI JS, urlencode PHP, \n, br html, nltobr, \r\n, etc,...

But it did't worked.

https://api.whatsapp./send?phone=XXXXXXXXXX&text=Hello%0AHow%20R%20U?

O/P:

I want this output using PHP/JavaScript:

Hello
How R U?

I have a already try encodeURI JS, urlencode PHP, \n, br html, nltobr, \r\n, etc,...

But it did't worked.

Share Improve this question edited Feb 25, 2019 at 5:42 Nick Parsons 51.2k6 gold badges57 silver badges78 bronze badges asked Feb 25, 2019 at 5:34 WO DevelopersWO Developers 3332 gold badges5 silver badges13 bronze badges 1
  • Hi! This link of api works? Have price for use? Limit messages per day? – Cristian Budzicz Commented May 3, 2020 at 12:33
Add a ment  | 

2 Answers 2

Reset to default 1

you have to encodeURI first:-

var whatsappMessage= "My First"+"\r\n\r\n"+"Message for Test";

 whatsappMessage = window.encodeURIComponent(whatsappMessage);

Sending encoded message as parameter like :-

send?text=whatsappMessage
  1. In PHP, for whatsapp message, to have line break, no javascript required:
$message = 'Hello'. urlencode("\n"). 'How R U?';
  1. Or create a variable to be used on any line:
$break = urlencode("\n");

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745202024a4616382.html

相关推荐

  • How to send new line whatsapp message using PHPJavaScript? - Stack Overflow

    ;text=Hello%0AHow%20R%20U?OP: I want this output using PHPJavaScript:HelloHow R U?I have a already t

    5小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信