本文整理汇总了PHP中remove_bad_chars函数的典型用法代码示例。如果您正苦于以下问题:PHP remove_bad_chars函数的具体用法?PHP remove_bad_chars怎么用?PHP remove_bad_chars使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了remove_bad_chars函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unset
unset($a_ppps[$pppid]['provider']);
unset($a_ppps[$pppid]['ondemand']);
}
if (in_array($wancfg['ipaddr'], array("pppoe", "pptp", "l2tp"))) {
unset($a_ppps[$pppid]['localip']);
unset($a_ppps[$pppid]['subnet']);
unset($a_ppps[$pppid]['gateway']);
}
if ($wancfg['ipaddr'] != 'pppoe') {
unset($a_ppps[$pppid]['pppoe-reset-type']);
}
if ($wancfg['type'] != $_POST['type']) {
unset($a_ppps[$pppid]['idletimeout']);
}
}
$wancfg['descr'] = remove_bad_chars($_POST['descr']);
$wancfg['enable'] = $_POST['enable'] == "yes" ? true : false;
/* let return_gateways_array() do the magic on dynamic interfaces for us */
switch ($_POST['type']) {
case "staticv4":
$wancfg['ipaddr'] = $_POST['ipaddr'];
$wancfg['subnet'] = $_POST['subnet'];
if ($_POST['gateway'] != "none") {
$wancfg['gateway'] = $_POST['gateway'];
}
break;
case "dhcp":
$wancfg['ipaddr'] = "dhcp";
$wancfg['dhcphostname'] = $_POST['dhcphostname'];
$wancfg['alias-address'] = $_POST['alias-address'];
$wancfg['alias-subnet'] = $_POST['alias-subnet'];
示例2: write_config
write_config();
add_base_packages_menu_items();
convert_config();
conf_mount_ro();
}
if ($m0n0wall_upgrade == true) {
if ($config['system']['gateway'] != "") {
$config['interfaces']['wan']['gateway'] = $config['system']['gateway'];
}
unset($config['shaper']);
/* optional if list */
$ifdescrs = get_configured_interface_list(true, true);
/* remove special characters from interface descriptions */
if (is_array($ifdescrs)) {
foreach ($ifdescrs as $iface) {
$config['interfaces'][$iface]['descr'] = remove_bad_chars($config['interfaces'][$iface]['descr']);
}
}
/* check for interface names with an alias */
if (is_array($ifdescrs)) {
foreach ($ifdescrs as $iface) {
if (is_alias($config['interfaces'][$iface]['descr'])) {
// Firewall rules
$origname = $config['interfaces'][$iface]['descr'];
$newname = $config['interfaces'][$iface]['descr'] . "Alias";
update_alias_names_upon_change(array('filter', 'rule'), array('source', 'address'), $newname, $origname);
update_alias_names_upon_change(array('filter', 'rule'), array('destination', 'address'), $newname, $origname);
// NAT Rules
update_alias_names_upon_change(array('nat', 'rule'), array('source', 'address'), $newname, $origname);
update_alias_names_upon_change(array('nat', 'rule'), array('destination', 'address'), $newname, $origname);
update_alias_names_upon_change(array('nat', 'rule'), array('target'), $newname, $origname);