本文整理汇总了PHP中Addresses::reformat_empty_array_fields方法的典型用法代码示例。如果您正苦于以下问题:PHP Addresses::reformat_empty_array_fields方法的具体用法?PHP Addresses::reformat_empty_array_fields怎么用?PHP Addresses::reformat_empty_array_fields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Addresses
的用法示例。
在下文中一共展示了Addresses::reformat_empty_array_fields方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sizeof
$address['firewallAddressObject'] = $_POST['firewallAddressObject'];
} else {
$address['firewallAddressObject'] = NULL;
}
}
}
# set and check permissions
$subnet_permission = $Subnets->check_permission($User->user, $address['subnetId']);
$subnet_permission > 1 ?: $Result->show("danger", _('Cannot edit IP address'), true);
# fetch subnet
$subnet = (array) $Subnets->fetch_subnet(null, $address['subnetId']);
if (@$_POST['verifydatabase'] !== "yes") {
sizeof($subnet) > 0 ?: $Result->show("danger", _("Invalid subnet"), true);
}
# replace empty fields with nulls
$address = $Addresses->reformat_empty_array_fields($address, null);
# custom fields and checks
$custom_fields = $Tools->fetch_custom_fields('ipaddresses');
if (sizeof($custom_fields) > 0) {
foreach ($custom_fields as $field) {
# replace possible ___ back to spaces!
$field['nameTest'] = str_replace(" ", "___", $field['name']);
if (isset($address[$field['nameTest']])) {
$address[$field['name']] = $address[$field['nameTest']];
}
# booleans can be only 0 and 1
if ($field['type'] == "tinyint(1)") {
if ($address[$field['name']] > 1) {
$address[$field['name']] = "";
}
}