[英]PHP how remove array from multidimensional array and create new array
I have this array: 我有这个数组:
array(3) {
["cod"]=> array(3) {
["code"]=> string(3) "cod"
["title"]=> string(38) "Pay on delivery"
["sort_order"]=> string(1) "1"
}
["pp_standard"]=> array(3) {
["code"]=> string(11) "pp_standard"
["title"]=> string(6) "PayPal"
["sort_order"]=> string(1) "1"
}
["bank_transfer"]=> array(3) {
["code"]=> string(13) "bank_transfer"
["title"]=> string(25) "bank_transfer"
["sort_order"]=> string(1) "2"
}
}
How I can remove full array 我如何删除整个阵列
["cod"]=> array(3) {
["code"]=> string(3) "cod"
["title"]=> string(38) "Pay on delivery"
["sort_order"]=> string(1) "1"
}
from the multidimensional array above and create new multidimensional array without ["cod"] array? 从上面的多维数组,并创建没有[“ cod”]数组的新多维数组? Thanks 谢谢
unset($arr['cod']);
is all you need. 是你所需要的全部。 Docs: http://php.net/manual/en/function.unset.php 文件: http : //php.net/manual/en/function.unset.php
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.