//echo $arr;
echo json_encode($arr);//编码为JSON字符串
$arr = ['eid'=>10,'ename'=>'Tom','isMarried'=>true, 'birthday'=>'2015-10-15'];
//echo $arr;
echo json_encode($arr);//编码为JSON字符串
//结论:索引数组会被json_encode转换为JSON数组,关联数组会被json_encode转换为JSON对象
[10,"Tom",true,"2015-10-15"]
{"eid":10,"ename":"Tom","isMarried":true,"birthday":"2015-10-15"}
$order = ['eid'=>10,'ename'=>'Tom','isMarried'=>true, 'birthday'=>'2015-10-15'];
$str = json_encode($order);
$logOrder = [];
$logOrder['orderId'] = 100;
$logOrder['orderStatus'] = 0;
$logOrder['logContent'] = "$str";
$logOrder['logType'] = 0;
$logOrder['logTime'] = time();
Db::name('log_order')->insert($logOrder);