I have an array like this:
Array(
[id-1] => N
[nm-1] => my_val_01;
[id-48] => S
[nm-48] => my_val_02;
[id-52] => N
[nm-52] => my_val_03;
[id-49] => N
[nm-49] => my_val_04;
[id-50] => N
[nm-50] => my_val_05;
}
and would like to filter by part of the key. In this case I would like to have all keys that have “id-“, and to result in this:
Array(
[id-1] => N
[id-48] => S
[id-52] => N
[id-49] => N
[id-50] => N
}
Can anyone help?
1 Answer