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.
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:
Array (  => tcp  => udp  => unix  => udg  => ssl  => tls  => tlsv1.0  => tlsv1.1  => tlsv1.2 )
Program 2: Program to check transports are available or not.
tcp: Enabled unix: Enabled file: Not Enabled ssl: Enabled GFG: Not Enabled
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.