把json数据 [ { } ] 转为数组
$str = '[{"rwx_price":388.5,"end_station_name":"长沙","swz_price":0,"swz_num":"--","to_station_name":"长沙","ydz_num":"--","yz_num":"*","rw_num":"*","arrive_days":"1","rz_num":"--","access_byidcard":"0","yz_price":138.5,"ywz_price":246.5,"sale_date_time":"1100","from_station_code":"CUW","rz_price":0,"gjrw_num":"--","to_station_code":"CSQ","ydz_price":0,"wz_price":138.5,"tdz_price":0,"run_time":"15:36","yw_num":"*","edz_price":0,"qtxb_price":0,"can_buy_now":"N","yw_price":238.5,"train_type":"K","rw_price":372.5,"note":"7月22日11点起售","train_no":"760000K5780K","train_code":"K579","from_station_name":"重庆北","run_time_minute":"936","ywx_price":255.5,"arrive_time":"05:28","start_station_name":"成都东","start_time":"13:52","wz_num":"*","edz_num":"--","qtxb_num":"--","train_start_date":"20160919","gjrw_price":0,"tdz_num":"--"},{"rwx_price":0,"end_station_name":"长沙","swz_price":0,"swz_num":"--","to_station_name":"长沙","ydz_num":"--","yz_num":"*","rw_num":"--","arrive_days":"1","rz_num":"--","access_byidcard":"0","yz_price":128.5,"ywz_price":230.5,"sale_date_time":"1100","from_station_code":"CUW","rz_price":0,"gjrw_num":"--","to_station_code":"CSQ","ydz_price":0,"wz_price":128.5,"tdz_price":0,"run_time":"14:10","yw_num":"*","edz_price":0,"qtxb_price":0,"can_buy_now":"N","yw_price":222.5,"train_type":"K","rw_price":0,"note":"7月22日11点起售","train_no":"760000K50406","train_code":"K504","from_station_name":"重庆北","run_time_minute":"850","ywx_price":237.5,"arrive_time":"06:22","start_station_name":"成都东","start_time":"16:12","wz_num":"*","edz_num":"--","qtxb_num":"--","train_start_date":"20160919","gjrw_price":0,"tdz_num":"--"},{"rwx_price":509.5,"end_station_name":"广州","swz_price":0,"swz_num":"--","to_station_name":"长沙","ydz_num":"--","yz_num":"*","rw_num":"*","arrive_days":"1","rz_num":"--","access_byidcard":"0","yz_price":180.5,"ywz_price":321.5,"sale_date_time":"1100","from_station_code":"CUW","rz_price":0,"gjrw_num":"--","to_station_code":"CSQ","ydz_price":0,"wz_price":180.5,"tdz_price":0,"run_time":"20:47","yw_num":"*","edz_price":0,"qtxb_price":0,"can_buy_now":"N","yw_price":310.5,"train_type":"K","rw_price":488.5,"note":"7月22日11点起售","train_no":"770000K35804","train_code":"K358","from_station_name":"重庆北","run_time_minute":"1247","ywx_price":331.5,"arrive_time":"20:07","start_station_name":"重庆北","start_time":"23:20","wz_num":"*","edz_num":"--","qtxb_num":"--","train_start_date":"20160919","gjrw_price":0,"tdz_num":"--" }]';
$str = json_decode($str,true); echo '<meta http-equiv="Content-type" content="text/html:charset=utf-8">';
echo '<pre>';
var_dump($str);exit;
把json数据 [ { } ] 转为数组的更多相关文章
- 花括号中的json数据--->转为数组array
//正式服务器 更换航班 public function changef(){ $str = '{"airportTax":50,"arriModifyTime" ...
- js声明json数据,打印json数据,遍历json数据,转换json数据为数组
1.js声明json数据: 2.打印json数据: 3.遍历json数据: 4.转换json数据为数组; //声明JSON var json = {}; json.a = 1; //第一种赋值方式(仿 ...
- php json字符串转为数组或对象
从网上查到的方法是 用get_object_vars 把类类型转换成数组 然后在用foreach 遍历即可 $array = get_object_vars($test); $json= '[{&q ...
- 使用superobject 新建Json数据(数组)
1. 要得到的Json数据:[{"name":"张三","age": 17},{"name":"李四" ...
- json数据转为对象,一般在前台把数据传回后端中使用 转https://www.cnblogs.com/zxtceq/p/6610214.html
public static JArray GetData2JArray(string url, string key) { string jsonData = HttpHelper.HttpGet(u ...
- json数据转为Map集合
我是利用Gson来弄得Gson gson = new Gson();//显得出HashMap的类型Type type = new TypeToken<HashMap<String, Str ...
- c# 将json数据转为键值对
string json = "{\"orderId\":\"000001\",\"haha\":\"001\" ...
- python json数据的转换
1 Python数据转json字符串 import json json_str = json.dumps(py_data) 参数解析: json_str = json.dumps(py_data,s ...
- 将Json数据转换为ADO.NET DataSet对象
Json数据转换为ADO.NET DataSet其实方法有很多,Newtonsoft.Json也提供了DataSet的Converter用以转换Json数据.但是有些情况下DataSet Conver ...
随机推荐
- JavaSE中主要的类与方法
1.instanceof:测试左边的对象是否是右边类的实例; 数组.length:返回的是数组的长度; 2.Scanner类 nextInt():读取键盘录入的整数; next():读取键 ...
- Python 实现类似PHP的strip_tags函数功能,并且可以自定义设置保留标签
最近在研究 Python ,发现用的还是很不习惯,很多PHP里面很简单的功能在Python 里面都得找半天,而且很多功能都得自己实现. 今天做个采集,需要过滤内容中的标签,搞了一下午,貌似终于搞出来了 ...
- CodeForces 709A Juicer
简单题. #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #inclu ...
- mysql 数据库知识
order by 字段 将查到的list集合按指定字段升序排序 order by 字段 DESC 将查到的list集合按指定字段降序排序 GROUP BY 语句用于结合合计函数,根据一个或多 ...
- Memcache(1)
一.缓存套路 原文地址:http://coolshell.cn/articles/17416.html Scaling Memcached at Facebook 好些人在写更新缓存数据代码时,先删除 ...
- Hadoop无法上传文件查找原因
部署了集群,上传测试文件到HDFS文件系统的时候出现问题.could only be replicated to 0 nodes, instead of 1,如下图所示: 度娘寻找解决方案: 博客链接 ...
- ubuntu enable all Ubuntu software (main universe restricted multiverse) repositories use
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe ...
- iherb账户
LMJ997 23622335@qq.com yjxwly***** LUR472 13821660226@163.com linda**** LFW887 bella****
- qemu毒液漏洞分析(2015.9)
0x00背景 安全娱乐圈媒体Freebuf对该漏洞的有关报道: 提供的POC没有触发崩溃,在MJ0011的博客给出了修改后可以使qemu崩溃的poc.详见: http://blogs.360.cn/b ...
- 找出Java数组中不同的值
public void deltp(PrintWriter out) { try{ PageData pd = new PageData(); pd = this.getPageData(); Str ...