【发布时间】:2015-07-23 20:50:17
【问题描述】:
我有两个数组:
$choices = array (
[model] => 3D Modeling / BIM
[edb] => Engineering & Design-Build
[gse] => Green & Sustainable Energy
[ipd] => Integrated Project Design
[lc] => Lean Construction
[mt] => Material Supply
[ecs] => Electrical Construction & Service
[fps] => Fire Protection Services
[hms] => HVAC & Mechanical Service
[tsl] => Traffic Signal & Lighting
)
$servicesSelected = array (
[model] => 0
[ipd] => 1
[lc] => 2
[mt] => 3
)
我正在尝试检查是否有任何数组 2 键等于数组 1 键,如果该键等于数组 2 键,则打印数组 1 中的值。我不完全确定从哪里开始。但在示例中,我会回应以下内容,因为它们的 keey 存在于比较中。
- 3D 建模/BIM
- 综合项目设计
- 精益建设
- 物资供应
【问题讨论】:
-
暴力破解:一个普通的循环......?
标签: php arrays function compare exists