Twilio api 中短信文本的格式

发布于 2024-09-28 13:43:47 字数 192 浏览 0 评论 0原文

我正在使用 twilio api 开发短信应用程序,我遇到了有关短信格式化的问题

1) php 中的字符串“我在这里” 短信正文是这样的 我在这里,

我不希望短信中出现斜杠

2) 我想在消息中添加换行符,我该怎么做。

像这样 姓名 年龄 电话 西默23 2546181541 马克25 3521447821

i am working on sms application with twilio api, i faced a problem about sms formatting

1) a string " i'm here" in php
this is going like this in sms body
i\'m here

i dont want that slash to come up in sms

2) i want to add line break in message how can i do that.

like this
Name age phone
Simer 23 2546181541
Mark 25 3521447821

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

长亭外,古道边 2024-10-05 13:43:47

Twilio 工作人员的回复:

如果其他人需要换行符,请确保您的 PHP 字符串用双引号引起来而不是单引号, \n 将起作用: http://php.net/手册/en/language.types.string.php

reply by Twilio staff:

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

美羊羊 2024-10-05 13:43:47

在 PHP 中,有一个 Magic Quotes 选项(虽然现在已弃用)转义某些字符a POST 和 GET。你可能正在遭受这样的痛苦。

In PHP there's a Magic Quotes option that (while deprecated now) escapes certain characters in a POSTs and GETs. You may be suffering from that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文