stream_get_transports()
stream_get_transports() — Retrieve list of registered socket transports.
Built-in function of PHP 8.5. The manual lists it as available in PHP 5, PHP 7, 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 indexed array containing the name of all socket transports available on the running system.
Signature
stream_get_transports(): array
Parameters
This function takes no parameters.
Return value
Returns an indexed array of socket transports names.
Example
A runnable snippet:
$xportlist = stream_get_transports(); print_r($xportlist);
Output:
Array ( [0] => tcp [1] => udp [2] => unix [3] => udg )
See also
stream_get_filters(), stream_get_wrappers()
All PHP 8.5 built-in functions
Reference card built from the PHP manual page stream_get_transports() (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.