get site url

Asked

Viewed 703 times

0

Well, here’s the thing url:

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

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

http://www.site.com.br

1 answer

3


Try $_SERVER['SERVER_NAME'].

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

I hope I’ve helped.

Job documentation here.

  • Thank you! Lack of attention on my part!

  • Dispose , here is for this very, ask questions.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.