我有这些数据:
var object = [{
"nid": "31",
"0": {
"tid": "20",
"name": "Bench Press",
"objectDate": "2012-02-08",
"goal": "rep",
"result": "55.00",
"comments": "sick!",
"maxload": "250"
},
"1": {
"tid": "22",
"name": "Back Squat",
"objectDate": "2012-02-08",
"goal": "time",
"result": "8.00",
"comments": "i was tired.",
"maxload": "310"
}},
{
"nid": "30",
"0": {
"tid": "19",
"name": "Fran",
"objectDate": "2012-02-07",
"goal": "time",
"result": "5.00",
"comments": null
}}];
我希望按名称对其进行过滤。例如,如果我应用了名为“Fran”的过滤器,我想得到像这样的结果:
[0] => Array
(
[tid] => 19
[name] => Fran
[objectDate] => 2012-02-07
[goal] => time
[result] => 5.00
[comments] =>
)
[1] => Array
(
[tid] => 19
[name] => Fran
[objectDate] => 2012-02-08
[goal] => rep
[result] => 55.00
[comments] => woohoo!
)
这个是否能实现?