1
은이 같은 배열 구조를 가지고PHP에서 상위 배열 키를 제거 하시겠습니까?
Array (
[donate] => Array
(
[amount_other] => 222
[pay_method] => Array
(
[5] => Array
(
[first_name] => sam
[last_name] => indi
[cc_type] => mc
[cc_number] => 5123456789
[cc_ccv2] => 111
[cc_exp_month] => 10
[cc_exp_year] => 20
)
)
[notes] => Test comment.
)
)
I 키를 삭제할을 [5] 어레이에서, 그래서 새로운 배열된다 :
Array
(
[donate] => Array
(
[amount_other] => 222
[pay_method] => Array
(
[first_name] => sam
[last_name] => indi
[cc_type] => mc
[cc_number] => 5123456789
[cc_ccv2] => 111
[cc_exp_month] => 10
[cc_exp_year] => 20
)
[notes] => Test comment.
)
배열 키가 변경되어 내부 배열에 직접 액세스하여 코드에서 매번 키를 변경할 필요가 없기 때문에이 옵션이 필요합니다. 이것을 달성하는 다른 방법이 있다면 .. 도와주세요. 미리 감사드립니다.