Well, I have the following url :
http://www.site.com.br/pasta1/pasta2/arquivo.php?parametro1=234&¶metro2=sim
I would like to know which variable of type $_SERVER[]
that returns only
http://www.site.com.br
Well, I have the following url :
http://www.site.com.br/pasta1/pasta2/arquivo.php?parametro1=234&¶metro2=sim
I would like to know which variable of type $_SERVER[]
that returns only
http://www.site.com.br
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 .