PHP | stream_get_transports() Function Last Updated : 11 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report The stream_get_transports() function is an inbuilt function in PHP which is used to get the list of registered socket transports. This function returns the indexed array containing the name of all available socket. Syntax: array stream_get_transports( void ) Parameters: This function does not accept any parameter. Return Value: This function returns an array containing the name of all available socket transport. Below programs illustrate the stream_get_transports() function in PHP: Program 1: PHP <?php // PHP program to illustrate // stream_get_transports function print_r(stream_get_transports()); ?> Output: Array ( [0] => tcp [1] => udp [2] => unix [3] => udg [4] => ssl [5] => tls [6] => tlsv1.0 [7] => tlsv1.1 [8] => tlsv1.2 ) Program 2: Program to check transports are available or not. php <?php // PHP program to illustrate // stream_get_transports function $wrapper = array ( 'tcp', 'unix', 'file', 'ssl', 'GFG' ); // Checking socket transport enabled or not foreach ($wrapper as &$gfg) { if (in_array($gfg, stream_get_transports())) { echo $gfg . ': Enabled' . "\n"; } else { echo $gfg . ": Not Enabled" . "\n"; } } ?> Output: tcp: Enabled unix: Enabled file: Not Enabled ssl: Enabled GFG: Not Enabled Reference: https://www.php.net/manual/en/function.stream-get-transports.php Comment More infoAdvertise with us Next Article PHP get_resources() Function R R_Raj Follow Improve Article Tags : Web Technologies PHP PHP-array PHP-function Similar Reads PHP | stream_get_wrappers() Function The stream_get_wrappers() function is an inbuilt function in PHP which is used to get the list of registered streams available on the running system. Syntax: array stream_get_wrappers( void ) Parameters: This function does not accept any parameter. Return Value: The function returns an array contain 1 min read PHP get_resources() Function The get_resources() function is an inbuilt function in PHP that returns active resources in an array form, & optionally, the resource type will be filtered. Syntax: array get_resources(?string $type = null)Parameters: This function accepts one parameter that is described below: type: This parame 1 min read PHP ob_get_status() Function The ob_get_status() is an inbuilt function in PHP that is used for retrieving the status of the output buffer. Syntaxob_get_status(bool $full_status = false) : arrayParameter This function accepts only one parameter which is described below. $full_status: This is an optional parameter. If this param 2 min read PHP get_resource_type() Function The get_resource_type() function is an inbuilt function in PHP that is used for returning the type of resource. Syntax: get_resource_type(resource $resource) Parameters: This function accepts one parameter that described below: $resource: This parameter specifies the evaluated resource handle name.R 1 min read PHP | stream_get_filters() Function The stream_get_filters() function is an inbuilt function in PHP which is used to get the list of registered stream filters. Syntax: array stream_get_filters( void ) Parameters: This function does not accept any parameter. Return Value: This function returns an array containing the name of all availa 1 min read PHP | stream_get_meta_data() Function The stream_get_meta_data() function is an inbuilt function in PHP which is used to get the header or meta data from the streams/file pointers.Syntax: array stream_get_meta_data( $stream ) Parameters: The function accepts single parameter $stream, which specifies the meta data to be retrieve and whic 2 min read Like