我有一个文本区域值,需要将其保存到数据库中,因为它.. 假设文本区域值如下:
我是州众议员内杜.我给你发这条消息是为了让 你知道我今天已经申请连任了.我希望我能数数 感谢您对我们活动的支持! https://secure.actblue.com/donate/reelectnaydu?refcode=filingtxt
回复停止 Select 退出
所以我想像这样将它保存在数据库中,
我是州众议员约翰·布莱恩特.我向您发送这条消息 让你知道我今天已经申请连任.我希望我能 期待您对我们活动的支持! \n\nhttps:secure.actblue.com/donate/reelectnaydu? refcode=文件文本\n\n回复 停止 Select 退出
我用这$communication->communication_text = $request->message;
行保存了它.但无法如愿保存.我该怎么做?
我想将变量发送到Curl请求以发送这样的API请求
CURLOPT_POSTFIELDS =>'{
"bulkId": "'.$communication->id.'",
"messages": [
{
"destinations": [
' . implode(',', $destinations) . '
],
"from": "'. $sender->sender_number.'",
"text": ".$communication->communication_text."
}
],
"tracking": {
"track": "SMS",
"type": "MY_CAMPAIGN"
}
}',
但我得到了解析错误:
"{"请求错误":{"serviceResponse":{"mailageId":"BAD_RECEST","text":"错误 同时解析请求正文.请判断您的语法."}}}"
Here is the snap of $communication->communication_text, If i hard coded the text everythings works fine, when i pass it from controller i got parsing Error.