我有以下数组:
$myArray
: array =
0: array =
0: string = 2012
1: string = 1
2: string = JOHN
1: array =
0: string = 2012
1: string = 2
2: string = JOHN
2: array =
0: string = 2012
1: string = 3
2: string = MARK
我也有变量 $name。假设这次 $name 等于 JOHN
我必须做些什么才能拥有一个新数组,其中仅包含包含 JOHN 的元素,如下所示:
$myArray
: array =
0: array =
0: string = 2012
1: string = 1
2: string = JOHN
1: array =
0: string = 2012
1: string = 2
2: string = JOHN
太感谢了!