我的代码需要帮助。从下面的数组中取消设置 xfer 数组:
if($_SESSION["s"]["user"]["typ"] == 'admin') {
$form["tabs"]['dns_soa'] = array (
'title' => "DNS Zone",
'width' => 100,
'template' => "templates/dns_soa_edit.htm",
'fields' => array (
##################################
# Begin Datatable fields
##################################
'xfer' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => '',
'value' => '',
'width' => '30',
'maxlength' => '255'
),
'update_acl' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => '',
'value' => '',
'width' => '30',
'maxlength' => '255'
),
'active' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'Y',
'value' => array(0 => 'N',1 => 'Y')
),
##################################
# ENDE Datatable fields
##################################
)
);
}
我只是:
unset($form["tabs"]['dns_soa']['fields']['xfer']);
并取消所有 3 我这样做。更新 - 实际上我在“字段”中有很多数组,但我只提供了 3 个:
unset($form["tabs"]['dns_soa']['fields']['xfer']);
unset($form["tabs"]['dns_soa']['fields']['update_acl']);
unset($form["tabs"]['dns_soa']['fields']['active']);
无论如何我可以在不
unset($form["tabs"]['dns_soa']['fields']array name here);
多次编码的情况下取消设置许多数组吗?提前致谢。
更新 - 很抱歉,我应该提供更多信息。如何禁用 3 个阵列中的 2 个?例如只禁用 ['xfer'] 和 ['active']?