0
我有一個特定的數組鍵,我想得到,但它是後綴增量計數器。從數組中獲取匹配鍵
Array
(
[nombre] => Carlos
[apellido] => Delfino
[sum1] => Array
(
[0] => Apple
[1] => Banana
[2] => Liquor
)
[sum3] => Array
(
[0] => Grapes
)
)
我打算把sum
鍵(SUM1 & SUM3)的新陣列上。 A foreach
在我的腦海中,但我懷疑我應該使用正則表達式還是PHP字符串函數。
foreach($arr as $k => $v)
{
//I'm lost here on how to match keys with at least `sum` word on it
}