我正在尝试在json变量中添加变量,然后尝试发送电子邮件,但我正在获取变量而不是变量值,请看一下:
$request_json = '{
"type":"messages",
"call":"send",
"message":{
"html":"$salesmsgUpdatemsg",
}';
$request_json = '{
"type":"messages",
"call":"send",
"message":{
"html":"'.$salesmsgUpdatemsg.'",
}';
如果我使用两个代码都无法正常工作
$request_json = '{
"type":"messages",
"call":"send",
"message":{
"html":"Content Text",
}';
它的工作正常。
不知道会发生什么。
谢谢
您应该遵循jeoren的建议,因为有一天您的代码将被破坏。
$request = array ('type'=>"messages",
'call'=>'send',
'message'=>array(
'html'=>$salesmsgUpdatemsg
));
$request_json = json_encode($request);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句