https://api.whatsapp.com/send?phone=XXXXXXXXXX&text=Hello%0AHow%20R%20U?
O / P:
我想要使用PHP / JavaScript的输出:
Hello
How R U?
我已经尝试使用encodeURI JS,urlencode PHP,\ n,br html,nltobr,\ r \ n等,...
但是没有用。
答案 0 :(得分:0)
var whatsappMessage= "My First"+"\r\n\r\n"+"Message for Test";
whatsappMessage = window.encodeURIComponent(whatsappMessage);
将编码后的消息作为参数发送:-
send?text=whatsappMessage
答案 1 :(得分:0)
$message = 'Hello'. urlencode("\n"). 'How R U?';
$break = urlencode("\n");