1

我正在使用 nexmo 服务将 SMS 发送到特定的希伯来语号码但消息以 %D7%AA%D7 的形式到达。(我的语言是 PHP),这是我的代码:

$message = $_REQUEST["message"];

//Build the url 
$url = 'https://rest.nexmo.com/sms/json?' . http_build_query(
    [
      'api_key' =>  '******',
      'api_secret' => '*******',
      'to' => '9725433131',
      'from' => '4416329600',
      'text' => urlencode($message)
    ]
);
//Send the data
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_ENCODING, 'UTF-8');
$response = curl_exec($ch);

echo $response;
4

1 回答 1

1

尝试type在请求中添加参数。

//Build the url 
$url = 'https://rest.nexmo.com/sms/json?' . http_build_query(
[
      'api_key' =>  '******',
      'api_secret' => '*******',
      'to' => '9725433131',
      'from' => '4416329600',
      'text' => urlencode($message),
      'type' => 'unicode'
    ]
);

您可以在 nexmo 文档页面中找到更多信息。

于 2017-05-26T09:19:29.000 回答