我使用Twilio到send an SMS message像這樣(示出的代碼相關的部分):發送使用Twilio
require('Twilio.php');
$body ="some example message body text";
$account_sid = 'XXXXXXX';
$auth_token = 'YYYYY';
$client = new Services_Twilio($account_sid, $auth_token);
$client->account->messages->create(array(
'To' => $phone,
'From' => "+15132592073",
'Body' => $body,
));
上述工作得很好,但是,如果我更改爲:
'Body' => "some example "+$test+" message body text";
郵件正文返回爲「0」。
我也試過:
$myMessage ="some example "+$test+" message body text";
然後:
$client->account->messages->create(array(
'To' => $phone,
'From' => "+15132592073",
'Body' => $myMessage,
));
但是,這產生同樣的結果( 「0」)。需要注意的是:
$myMessage ="some example message body text";
這也能正常工作(不變量,即同樣的事情)
缺少什麼我在這裏?
使用。連接字符串在php – Vanojx1
@ Vanojx1這就是它...太多的時間工作在JavaScript/jQuery – jonmrich
我知道的感覺;) – Vanojx1