如何在SMS中使用Unicode或特殊字符(Twilio、Plivo)
在这种情况下,我必须发送短信,在短信内容的开头有两个空格,如下所示如何在SMS中使用Unicode或特殊字符(Twilio、Plivo),twilio,sms-gateway,plivo,Twilio,Sms Gateway,Plivo,在这种情况下,我必须发送短信,在短信内容的开头有两个空格,如下所示 setparam 3003:70eac; %20%20setparam%203003%3A70eac%3B 这适用于某些设备配置。但是,当收到短信时,它是 setparam 3003:70eac; 空白区消失了。 这就是我用php助手库发送短信的方式 $client = new Client($account_sid, $auth_token); $client->messages->create(
setparam 3003:70eac;
%20%20setparam%203003%3A70eac%3B
这适用于某些设备配置。但是,当收到短信时,它是
setparam 3003:70eac;
空白区消失了。
这就是我用php助手库发送短信的方式
$client = new Client($account_sid, $auth_token);
$client->messages->create(
'<to_number>',
array(
'from' => '<from_number>',
'body' => ' setparam 3003:70eac;'
)
);
此结果不需要解析
%20%20setparam%203003%3A70eac%3B
任何帮助都将是对我的巨大支持。在Twilio或Plivo中发送短信时,我们无法正常使用whitspaces,因为这些短信会自动被修剪。但是可以通过转义消息中的whitspace来发送 示例:
' Whitspace at front'
蟒蛇
在Twilio或Plivo中发送短信时,我们无法正常使用whitspaces,因为这些短信会被自动修剪。但是可以通过转义消息中的whitspace来发送 示例:
' Whitspace at front'
蟒蛇
在twilio中,您必须使用Unicode“标点符号空间”,即“\2008”\0020“不起作用。在twilio中,您必须使用Unicode的“标点符号空间”,即“\2008”\0020'不起作用。尝试使用unicode空白,即 ;我试过了。这没用。我以字符串“ ”的形式发送,尝试使用unicode空白,即 ;我试过了。这没用。我以字符串“ ;”的形式发送
<?php
// Required if your environment does not handle autoloading
require __DIR__ . '/vendor/autoload.php';
// Use the REST API Client to make requests to the Twilio REST API
use Twilio\Rest\Client;
// Your Account SID and Auth Token from twilio.com/console
$sid = 'ACfe1c3f0e87c51710e95e842f2e71922b';
$token = 'your_auth_token';
$client = new Client($sid, $token);
// Use the client to do fun stuff like send text messages!
$client->messages->create(
// the number you'd like to send the message to
'+15558675309',
array(
// A Twilio phone number you purchased at twilio.com/console
'from' => '+15017250604',
// the body of the text message you'd like to send
'body' => "\020\020Whitspace at front"
)
);
' Whitspace at front'