我有JSON对象数组,如下所示。以下JSON对象数组位于文件((feeds / ptp-ess_landing_house.json)中{
"joint_committees": ["1", "2"],
"code": ["CACN", "CHPC", "CIIT", "CIMM", "ENVI", "ETHI", "FAAE"]
}
Php代码:<?php
if (file_exists('feeds/ptp-ess_landing_house.json')) {
$data_house = json_decode(file_get_contents('feeds/ptp-ess_landing_house.json')); // Line A
}
?>
<?php foreach ($data_house->joint_committees as $key => $value) { ?>
B行打印CHPC和CIIT
问题陈述:
我想知道我应该在上面的php代码中进行哪些更改,以便它显示CACN,CIMM,ENVI,ETHI和FAAE。
总之,我想从code中删除其索引在joint_committees中列出的那些元素>
我有JSON对象数组,如下所示。以下JSON对象数组位于文件(feeds / ptp-ess_landing_house.json){“ joint_committees”:[“ 1”,“ 2”],“ code”:[“ CACN”,“ CHPC”,“ CIIT”, ...