get url from site

0

Well, I have the following url :

http://www.site.com.br/pasta1/pasta2/arquivo.php?parametro1=234&&parametro2=sim

I would like to know which variable of type $_SERVER[] that returns only

http://www.site.com.br
    
asked by anonymous 14.11.2017 / 15:39

1 answer

3

Try $_SERVER['SERVER_NAME'] .

If you need the rest of the url you can use the 'REQUEST_URI' and 'PATH_INFO' arguments.

I hope I have helped.

Function documentation here .

    
14.11.2017 / 15:56