欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

json_encode用法_PHP教程

程序员文章站 2022-06-11 12:39:41
...

$query=mysql_query($SQL);
while($row = mysql_fetch_array($query)){
$xdata[]=$row['EventDate'];
$ydata[]=intval($row['data']);
}

$data_arr=array($xdata,$ydata)

json_encode($data_arr);

$.ajax({
type: "Get",
url: "columndata.php?r=" + Math.floor(Math.random() * 1000 + 1),
data: { 'BeginTime': "" + beginTime + "", "EndTime": "" + endTime + "" , "keyword": "" + keyword + "" },
dataType: "text",
global: false,
async: false,
success: function (strReult) {
if (strReult == "-1") { alert("fail!"); return; }




},
error: function () {
alert("fail!");
}
});

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/440196.htmlTechArticle$query=mysql_query($SQL); while($row = mysql_fetch_array($query)){ $xdata[]=$row['EventDate']; $ydata[]=intval($row['data']); } $data_arr=array($xdata,$ydata) json_encode($data_a...