php 如何处理这个json数据, '{"groupOp":"AND","rules":[{"field":"sn","op":"eq","data":"ddde"}]}'这个 20
1个回答
2012-05-26 · 知道合伙人软件行家
关注
展开全部
<?php
$json = '{"groupOp":"AND","rules":[{"field":"sn","op":"eq","data":"ddde"}]}';
$arr = (array) json_decode($json,true);
echo '当前生成的查询语句是:'. $arr['rules'][0]['field'] . ' ' . $arr['rules'][0]['op'] . ' ' . $arr['rules'][0]['data'];
?>
$json = '{"groupOp":"AND","rules":[{"field":"sn","op":"eq","data":"ddde"}]}';
$arr = (array) json_decode($json,true);
echo '当前生成的查询语句是:'. $arr['rules'][0]['field'] . ' ' . $arr['rules'][0]['op'] . ' ' . $arr['rules'][0]['data'];
?>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询