您好,我有php
多維數組我想從每個數組中刪除索引,我的數組是這樣最好的方法,從所有的數組中刪除特定指數在多維數組PHP
Array
(
[0] => Array
(
[ProfilePrivacySettingDefaultID] => 1
[UserType] => 2
[Type] => 1
[EntityID] => 0
[PrivacySettingPublic] => 1
[PrivacySettingElephantiUser] => 1
[PrivacySettingFriend] => 1
[IsValid] => 1
[CreatedOn] => 1330580809
[CreatedBy] => 0
[UpdatedOn] => 0
[UpdatedBy] => 0
)
[1] => Array
(
[ProfilePrivacySettingDefaultID] => 2
[UserType] => 2
[Type] => 1
[EntityID] => 0
[PrivacySettingPublic] => 1
[PrivacySettingElephantiUser] => 1
[PrivacySettingFriend] => 1
[IsValid] => 1
[CreatedOn] => 1330580809
[CreatedBy] => 0
[UpdatedOn] => 0
[UpdatedBy] => 0
)
[2] => Array
(
[ProfilePrivacySettingDefaultID] => 3
[UserType] => 2
[Type] => 1
[EntityID] => 0
[PrivacySettingPublic] => 1
[PrivacySettingElephantiUser] => 1
[PrivacySettingFriend] => 1
[IsValid] => 1
[CreatedOn] => 1330580809
[CreatedBy] => 0
[UpdatedOn] => 0
[UpdatedBy] => 0
)
[3] => Array
(
[ProfilePrivacySettingDefaultID] => 4
[UserType] => 2
[Type] => 1
[EntityID] => 0
[PrivacySettingPublic] => 1
[PrivacySettingElephantiUser] => 1
[PrivacySettingFriend] => 1
[IsValid] => 1
[CreatedOn] => 1330580809
[CreatedBy] => 0
[UpdatedOn] => 0
[UpdatedBy] => 0
)
);
我想指數ProfilePrivacySettingDefaultID
從所有陣列,因此最後的結果會是這樣
Array
(
[0] => Array
(
[UserType] => 2
[Type] => 1
[EntityID] => 0
[PrivacySettingPublic] => 1
[PrivacySettingElephantiUser] => 1
[PrivacySettingFriend] => 1
[IsValid] => 1
[CreatedOn] => 1330580809
[CreatedBy] => 0
[UpdatedOn] => 0
[UpdatedBy] => 0
)
[1] => Array
(
[UserType] => 2
[Type] => 1
[EntityID] => 0
[PrivacySettingPublic] => 1
[PrivacySettingElephantiUser] => 1
[PrivacySettingFriend] => 1
[IsValid] => 1
[CreatedOn] => 1330580809
[CreatedBy] => 0
[UpdatedOn] => 0
[UpdatedBy] => 0
)
[2] => Array
(
[UserType] => 2
[Type] => 1
[EntityID] => 0
[PrivacySettingPublic] => 1
[PrivacySettingElephantiUser] => 1
[PrivacySettingFriend] => 1
[IsValid] => 1
[CreatedOn] => 1330580809
[CreatedBy] => 0
[UpdatedOn] => 0
[UpdatedBy] => 0
)
[3] => Array
(
[UserType] => 2
[Type] => 1
[EntityID] => 0
[PrivacySettingPublic] => 1
[PrivacySettingElephantiUser] => 1
[PrivacySettingFriend] => 1
[IsValid] => 1
[CreatedOn] => 1330580809
[CreatedBy] => 0
[UpdatedOn] => 0
[UpdatedBy] => 0
)
);
什麼是做到這一點的最好辦法,非常感謝你..............
爲什麼這個表決和標記爲接受的答案。它不起作用。該數組需要返回,否則$ your_array將只是空的 – TarranJones 2015-09-03 09:14:18