Get protocol and PHP domain

-2

How can I get protocol and domain in php

$ protocol = stripos ($ _ SERVER ['SERVER_PROTOCOL'], 'https') === true? 'https: //': 'http: //';

$ domain = $ _SERVER ['HTTP_HOST'];

    
asked by Alberto T 18.07.2018 в 09:54
source

1 answer

0

This works correctly

$ protocol = stripos ($ _ SERVER ['SERVER_PROTOCOL'], 'https') === true? 'https: //': 'http: //';

$ domain = $ _SERVER ['HTTP_HOST'];

    
answered by 18.07.2018 в 09:54