php变量插入在json中格式出错

https://img4.mukewang.com/5c8f64c50001fea408000242.jpg

 $pdata='{
"touser":"$openid",
"template_id":"Tcj_l-RgdEQ_ppjE7SE_Uo-G-ME51HIzbZsjLqp5mso",
"url":"https://jc.sdp178.com/web/dgoods.html?oddnumtracking_number=886594027291530556&logistics_company=YTO",
"topcolor":"#FF0000",
"data":{
  "name":{
  "value":"商品名字",
  "color":"#173177"
  },
  "remark":{
  "value":"测试",
  "color":"#173177"
  }
}
}';

不用json_decode()的情况该怎么写,才符合json格式又可以输出php的变量

汪汪一只猫
浏览 434回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP