本文整理汇总了PHP中Network::getUserHostAddress方法的典型用法代码示例。如果您正苦于以下问题:PHP Network::getUserHostAddress方法的具体用法?PHP Network::getUserHostAddress怎么用?PHP Network::getUserHostAddress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Network
的用法示例。
在下文中一共展示了Network::getUserHostAddress方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDetails
public function getDetails($grant)
{
$remoteHost = Network::getUserHostName();
if ($remoteHost == null) {
return "unable to resolve the host name for " . Network::getUserHostAddress();
}
$details = "Remote host name ";
$details .= $remoteHost;
if ($grant) {
$details .= " does not match ";
} else {
$details .= " matches ";
}
if ($this->m_isMask) {
$details .= " the mask of a host name: ";
} else {
$details .= " the host name: ";
}
$details .= $this->m_hostName;
$details .= ". access to this host has been";
if ($grant) {
$details .= " granted";
} else {
$details .= " rejected";
}
return $details;
}
示例2: getDetails
public function getDetails($grant)
{
$details = "Remote address ";
$details .= Network::getUserHostAddress();
if ($grant) {
$details .= " does not belong ";
} else {
$details .= " belongs ";
}
$details .= " to the group of computers with the following IP range:\n\tfrom: ";
$details .= $this->m_subnetAddress;
$details .= "\n\tto:";
$details .= $this->m_to;
$details .= "\naccess to this group has been ";
if ($grant) {
$details .= " granted ";
} else {
$details .= " rejected ";
}
return $details;
}
示例3: getDetails
public function getDetails($grant)
{
$remoteAddr = Network::getUserHostAddress();
$details = "Remote host address ";
$details .= $remoteAddr;
if ($grant) {
$details .= " does not match ";
} else {
$details .= " matches ";
}
if ($this->m_isMask) {
$details .= " the mask of a IP address: ";
} else {
$details .= " the IP address: ";
}
$details .= $this->m_ipAddress;
$details .= ". access to this address has been ";
if ($grant) {
$details .= " granted";
} else {
$details .= " rejected";
}
return $details;
}