How can PHP be used to check if a web server supports SSL/HTTPS connections?

To check if a web server supports SSL/HTTPS connections, you can use PHP's `stream_socket_client` function to attempt to establish an SSL connection with the server. If the connection is successful, it means that the server supports SSL/HTTPS.

$context = stream_context_create([
    'ssl' => [
        'verify_peer' => false,
        'verify_peer_name' => false,
    ]
]);

$fp = stream_socket_client('ssl://example.com:443', $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $context);

if ($fp) {
    echo 'SSL/HTTPS connection is supported';
    fclose($fp);
} else {
    echo 'SSL/HTTPS connection is not supported';
}