代码拉取完成,页面将自动刷新
<?php
ini_set("display_errors", "on");
$url = "http://filter.chnedu.com/v2/putdata";
$arr = array(
array(
"word"=>"雪狐",
"version"=>'201601',
"type" => "1",
"site" => "0",
"system" => "0",
"iswhitelist" => "0",
"level" => 2,
"create_time" => "2016-09-06 09:33:39",),
array(
"word"=>"huo狐",
"version"=>'201601',
"type" => "1",
"site" => "0",
"system" => "0",
"iswhitelist" => "0",
"level" => 2,
"create_time" => "2016-09-06 09:33:39",),
);
$jsonstr1 = json_encode($arr);
$jsonstr2 = '{"words":'.$jsonstr1.'}';
echo $jsonstr2;
//exit;
$ch = curl_init('http://filter.chnedu.com/v2/putdata');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS,$jsonstr2);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($jsonstr2))
);
$result = json_decode(curl_exec($ch),true);
//$result = curl_exec($ch);
var_dump($result);
// var_dump($ch);
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。