简体   繁体   English

Twilio API中的短信文本格式

[英]Format of sms text in Twilio api

i am working on sms application with twilio api, i faced a problem about sms formatting 我正在使用twilio api开发短信应用程序,但遇到短信格式化问题

1) a string " i'm here" in php this is going like this in sms body i\\'m here 1)一个字符串“我在这里”在PHP中这就像在短信正文中我在这里

i dont want that slash to come up in sms 我不希望这个斜线出现在短信中

2) i want to add line break in message how can i do that. 2)我想在消息中添加换行符,我该怎么做。

like this Name age phone Simer 23 2546181541 Mark 25 3521447821 像这样的名字年龄电话Simer 23 2546181541 Mark 25 3521447821

reply by Twilio staff: Twilio工作人员的回复:

If anyone else needs newlines, make sure your PHP strings are double quoted instead of single quoted and the \\n will work: http://php.net/manual/en/language.types.string.php 如果其他任何人需要换行符,请确保您的PHP字符串用双引号而不是单引号引起,并且\\ n可以使用: http : //php.net/manual/en/language.types.string.php

In PHP there's a Magic Quotes option that (while deprecated now) escapes certain characters in a POSTs and GETs. 在PHP中,有一个Magic Quotes选项(现在不建议使用)在POST和GET中转义某些字符。 You may be suffering from that. 您可能正在遭受这种痛苦。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM