PHP - Manual: radius_cvt_addr
2024-11-14
(PECL radius >= 1.1.0)
radius_cvt_addr — Converts raw data to IP-Address
$data
): stringConverts raw data to IP-Address
data
Input data
Returns the IP-Address.
示例 #1 radius_cvt_addr() example
<?php
while ($resa = radius_get_attr($res)) {
if (!is_array($resa)) {
printf ("Error getting attribute: %s\n", radius_strerror($res));
exit;
}
$attr = $resa['attr'];
$data = $resa['data'];
switch ($attr) {
case RADIUS_FRAMED_IP_ADDRESS:
$ip = radius_cvt_addr($data);
echo "IP: $ip<br>\n";
break;
case RADIUS_FRAMED_IP_NETMASK:
$mask = radius_cvt_addr($data);
echo "MASK: $mask<br>\n";
break;
}
}
?>
官方地址:https://www.php.net/manual/en/function.radius-cvt-addr.php