php8.5
Home/ Manual/ stream / functions/ stream_get_transports

stream_get_transports

PHP function Edit on GitHub ✎

(PHP 5, PHP 7, PHP 8)

Retrieve list of registered socket transports

Description

stream_get_transports(): array

Returns an indexed array containing the name of all socket transports available on the running system.

Parameters Parameters

Return Values

Returns an indexed array of socket transports names.

Examples

Using stream_get_transports()

php
<?php
$xportlist = stream_get_transports();
print_r($xportlist);
?>

The above example will output something similar to:

output
Array (
  [0] => tcp
  [1] => udp
  [2] => unix
  [3] => udg
)

See Also

Source: reference/stream/functions/stream-get-transports.xml · from the official PHP manual (php/doc-en)