当前位置: 首页>>代码示例>>PHP>>正文


PHP Addresses::identify_address方法代码示例

本文整理汇总了PHP中Addresses::identify_address方法的典型用法代码示例。如果您正苦于以下问题:PHP Addresses::identify_address方法的具体用法?PHP Addresses::identify_address怎么用?PHP Addresses::identify_address使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Addresses的用法示例。


在下文中一共展示了Addresses::identify_address方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

        <input type="checkbox" name="unique" value="1" <?php 
    print $delete;
    ?>
><?php 
    print _('Unique hostname');
    ?>
        </div>
        </td>
    </tr>
    <?php 
}
?>

	<?php 
#get type
$type = $Addresses->identify_address($subnet['subnet']);
if ($subnet['mask'] < 31 && ($action == 'add' || substr($action, 0, 4) == "all-") && $type == "IPv4") {
    ?>
	 <!-- ignore NW /BC checks -->
	 <tr>
		<td><?php 
    print _('Not strict');
    ?>
</td>
		<td>
		<div class='checkbox info2'>
			<input type="checkbox" name="nostrict" value="yes"><?php 
    print _('Permit adding network/broadcast as IP');
    ?>
		</div>
		</td>
开发者ID:mwodz,项目名称:phpipam,代码行数:31,代码来源:address-modify.php

示例2: dirname

$search_term = $_REQUEST['search_term'];
//initialize Pear IPv6 object
require_once dirname(__FILE__) . '/../../../functions/PEAR/Net/IPv6.php';
$Net_IPv6 = new Net_IPv6();
// ipv6 ?
if ($Net_IPv6->checkIPv6($search_term) != false) {
    $type = "IPv6";
} elseif (strlen($search_term) == 17 && substr_count($search_term, ":") == 5) {
    $type = "mac";
    //count : -> must be 5
} else {
    if (strlen($search_term) == 12 && substr_count($search_term, ":") == 0 && substr_count($search_term, ".") == 0) {
        $type = "mac";
        //no dots or : -> mac without :
    } else {
        $type = $Addresses->identify_address($search_term);
        //identify address type
    }
}
# reformat if IP address for search
if ($type == "IPv4") {
    $search_term_edited = $Tools->reformat_IPv4_for_search($search_term);
} elseif ($type == "IPv6") {
    $search_term_edited = $Tools->reformat_IPv6_for_search($search_term);
}
//reformat the IPv4 address!
# get all custom fields
$custom_address_fields = $Tools->fetch_custom_fields("ipaddresses");
$custom_subnet_fields = $Tools->fetch_custom_fields("subnets");
$custom_vlan_fields = $Tools->fetch_custom_fields("vlans");
# set selected address fields array
开发者ID:martinsv,项目名称:phpipam,代码行数:31,代码来源:search-results-export.php

示例3: calculate_ip_calc_results

 /**
  * Calculates IP calculator result per IP type
  *
  * @access public
  * @param mixed $cidr
  * @return void
  */
 public function calculate_ip_calc_results($cidr)
 {
     # addresses class
     $Addresses = new Addresses($this->Database);
     # detect address and calculate
     return $Addresses->identify_address($cidr) == "IPv6" ? $this->calculate_IPv6_calc_results($cidr) : $this->calculate_IPv4_calc_results($cidr);
 }
开发者ID:jonashauge,项目名称:phpipam,代码行数:14,代码来源:class.Tools.php


注:本文中的Addresses::identify_address方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。