本文整理汇总了PHP中filter_expand_alias_array函数的典型用法代码示例。如果您正苦于以下问题:PHP filter_expand_alias_array函数的具体用法?PHP filter_expand_alias_array怎么用?PHP filter_expand_alias_array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了filter_expand_alias_array函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: delete_static_route
function delete_static_route($id)
{
global $config, $a_routes, $changedesc_prefix;
if (!isset($a_routes[$id])) {
return;
}
$targets = array();
if (is_alias($a_routes[$id]['network'])) {
foreach (filter_expand_alias_array($a_routes[$id]['network']) as $tgt) {
if (is_ipaddrv4($tgt)) {
$tgt .= "/32";
} else {
if (is_ipaddrv6($tgt)) {
$tgt .= "/128";
}
}
if (!is_subnet($tgt)) {
continue;
}
$targets[] = $tgt;
}
} else {
$targets[] = $a_routes[$id]['network'];
}
foreach ($targets as $tgt) {
$family = is_subnetv6($tgt) ? "-inet6" : "-inet";
mwexec("/sbin/route delete {$family} " . escapeshellarg($tgt));
}
unset($targets);
}
开发者ID:rohankapoorcom,项目名称:pfsense,代码行数:30,代码来源:system_routes.php
示例2: count
$tgt .= "/32";
}
if (!is_subnet($tgt)) {
continue;
}
$new_targets[] = $tgt;
}
}
if (!isset($id)) {
$id = count($a_routes);
}
$oroute = $a_routes[$id];
if (!empty($oroute)) {
$old_targets = array();
if (is_alias($oroute['network'])) {
foreach (filter_expand_alias_array($oroute['network']) as $tgt) {
if (is_ipaddr($tgt)) {
$tgt .= "/32";
}
if (!is_subnet($tgt)) {
continue;
}
$old_targets[] = $tgt;
}
} else {
$old_targets[] = $oroute['network'];
}
}
$overlaps = array_intersect($current_targets, $new_targets);
$overlaps = array_diff($overlaps, $old_targets);
if (count($overlaps)) {
开发者ID:rdmenezes,项目名称:pfsense,代码行数:31,代码来源:system_routes_edit.php
注:本文中的filter_expand_alias_array函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论