php8.5
Home/ Manual/ radius / functions/ radius_get_tagged_attr_data

radius_get_tagged_attr_data

PHP function Edit on GitHub ✎

(PECL radius >= 1.3.0)

Extracts the data from a tagged attribute

Description

radius_get_tagged_attr_data(string $data): string|false

If a tagged attribute has been returned from radius_get_attr(), radius_get_tagged_attr_data() will return the data from the attribute.

Parameters

data

The tagged attribute to be decoded.

Return Values

Returns the data from the tagged attribute Falseforfailure.

Examples

radius_get_tagged_attr_data() example

php
<?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'];

    $tag = radius_get_tagged_attr_tag($data);
    $value = radius_get_tagged_attr_data($data);

    printf("Got tagged attribute with tag %d and value %s\n", $tag, $value);
}
?>

See Also

Source: reference/radius/functions/radius-get-tagged-attr-data.xml · from the official PHP manual (php/doc-en)