當前位置: 首頁>>代碼示例>>PHP>>正文


PHP remove_bad_chars函數代碼示例

本文整理匯總了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'];
開發者ID:simudream,項目名稱:pfsense,代碼行數:31,代碼來源:interfaces.php

示例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);
開發者ID:jdillard,項目名稱:pfsense,代碼行數:31,代碼來源:diag_backup.php


注:本文中的remove_bad_chars函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。