gpt4 book ai didi

php - 如何在满足条件时从数组中删除元素

转载 作者:可可西里 更新时间:2023-11-01 01:04:36 25 4
gpt4 key购买 nike

<分区>

给定以下数组:

Array
(
[0] => Array
(
[id_contract] => 1
[contract_months] => 5
[months_with_expenses] => 1
)

[1] => Array
(
[id_contract] => 2
[contract_months] => 12
[months_with_expenses] => 0
)

[2] => Array
(
[id_contract] => 3
[contract_months] => 1
[months_with_expenses] => 1
)

)

如何从数组中删除键“contract_months”与键“month_with_expenses”不匹配的所有元素?

我正在使用 PHP。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com