HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

socket_addrinfo_explain

Description

The socket_addrinfo_explain of Sockets for PHP get information about addrinfo.

Syntax

socket_addrinfo_explain(
    AddressInfo $address
): array

Parameters

address

AddressInfo instance created from socket_addrinfo_lookup()

Return

Returns an array containing the fields in the addrinfo structure.

Examples

1 · address

<?

$host = '127.0.0.1';

$address = socket_addrinfo_lookup($host)[0];

$return = socket_addrinfo_explain($address);

print_r($return);
Array
(
    [ai_flags] => 0
    [ai_family] => 2
    [ai_socktype] => 1
    [ai_protocol] => 6
    [ai_addr] => Array
        (
            [sin_port] => 0
            [sin_addr] => 127.0.0.1
        )

)