从头到尾记录json获取记录

时间:2015-02-19 21:14:10

标签: javascript php json

您好我希望得到一组记录的例子我得到了50条记录,我只想从8到16,来自Json。

从200条记录中记录到16条记录。

[  
   {  
      "name":"101 Lions",
      "gameid":"G113",
      "sessiondate":"Jul 15, 2014",
      "lastactivity":"Jul 15, 2014 6:16:55 PM",
      "playerid":"39",
      "totalbet":77436700,
      "totalwin":40879900,
      "eventcount":112
   },
   {  
      "name":"American Wild",
      "gameid":"G139",
      "sessiondate":"Jul 15, 2014",
      "lastactivity":"Jul 15, 2014 6:18:44 PM",
      "playerid":"39",
      "totalbet":5000,
      "totalwin":0,
      "eventcount":1
   },
   {  
      "name":"Angkor",
      "gameid":"G108",
      "sessiondate":"Jul 15, 2014",
      "lastactivity":"Jul 15, 2014 4:06:12 PM",
      "playerid":"39",
      "totalbet":2500,
      "totalwin":0,
      "eventcount":1
   },
   {  
      "name":"Buffalo Run",
      "gameid":"G127",
      "sessiondate":"Jul 15, 2014",
      "lastactivity":"Jul 15, 2014 6:21:52 PM",
      "playerid":"39",
      "totalbet":70000,
      "totalwin":157500,
      "eventcount":14
   },
   {  
      "name":"Highlands",
      "gameid":"G122",
      "sessiondate":"Jul 15, 2014",
      "lastactivity":"Jul 15, 2014 6:57:00 PM",
      "playerid":"39",
      "totalbet":10000,
      "totalwin":0,
      "eventcount":4
   },
   {  
      "name":"Indian Chief",
      "gameid":"G107",
      "sessiondate":"Jul 15, 2014",
      "lastactivity":"Jul 15, 2014 4:06:33 PM",
      "playerid":"39",
      "totalbet":2500,
      "totalwin":0,
      "eventcount":1
   },
   {  
      "name":"Jester",
      "gameid":"G147",
      "sessiondate":"Jul 15, 2014",
      "lastactivity":"Jul 15, 2014 4:06:43 PM",
      "playerid":"39",
      "totalbet":10000,
      "totalwin":1500,
      "eventcount":2
   },
   {  
      "name":"Kassandra",
      "gameid":"G151",
      "sessiondate":"Jul 15, 2014",
      "lastactivity":"Jul 15, 2014 6:25:02 PM",
      "playerid":"39",
      "totalbet":12500,
      "totalwin":500,
      "eventcount":5
   },
]

1 个答案:

答案 0 :(得分:1)

将您的数据存储在var说(yourData

然后

slicedData = yourData.slice(7,18);

将为您提供8到18的数据。