PHP Function Reference

PHP stream_get_transports() Function



The PHP stream_get_transports() function returns an indexed array containing the name of all registered socket transports available on the running system.

Syntax

stream_get_transports()

Parameters

No parameter is required.

Return Value

Returns an indexed array of socket transports names.

Example: stream_get_transports() example

The example below shows the usage of stream_get_transports() function.

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

The output of the above code will be similar to:

Array
(
    [0] => tcp
    [1] => udp
    [2] => unix
    [3] => udg
    [4] => ssl
    [5] => tls
    [6] => tlsv1.0
    [7] => tlsv1.1
    [8] => tlsv1.2
    [9] => tlsv1.3
)

❮ PHP Streams Reference