net_get_interfaces()
net_get_interfaces() — Get network interfaces.
Built-in function of PHP 8.5. The manual lists it as available in PHP 7 >= 7.3, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.
What it does
Returns an enumeration of network interfaces (adapters) on the local machine.
Signature
net_get_interfaces(): array|false
Parameters
This function takes no parameters.
Return value
Returns an associative array where the key is the name of the interface and the value an associative array of interface attributes, or false on failure. Each interface associative array contains: Interface attributes Name Description description Optional string value for description of the interface. Windows only. mac Optional string value for MAC address of the interface. Windows only. mtu Integer value for Maximum transmission unit (MTU) of the interface. Windows only. unicast Array of associative arrays, see Unicast attributes below. up Boolean status (on/off) for interface. Unicast attributes Name Description flags Integer value. family Integer value. address String value for address in ...
Example
The PHP manual ships no example for net_get_interfaces(); the signature and the parameter table above are the contract.
All PHP 8.5 built-in functions
Reference card built from the PHP manual page net_get_interfaces() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.