鍍金池/ 問答/數(shù)據(jù)分析&挖掘  Java  PHP  Linux/ 以逗號分開的值,用curl and json傳送給http

以逗號分開的值,用curl and json傳送給http

假設(shè)欄位值

2018/04/16, 2018/04/17, 2018/04/18, 2018/04/19, 2018/04/20, 2018/04/21, 2018/04/28

當(dāng)我另一面處理的時候
如何轉(zhuǎn)換成 array 並且丟json給指定的http? 利用curl

$data = array(
    "date" => $date
  );
  $data_string = json_encode($data);
  $ch = curl_init($api_signin);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
  curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
  $result = curl_exec($ch);
  curl_close($ch);

$date這邊怎麼寫才對?。?/p>

回答
編輯回答
幼梔
$data = array('2018/04/16','2018/04/17','2018/04/18','2018/04/19','2018/04/20','2018/04/21','2018/04/28');
2018年5月15日 02:25