How to get current site URL without http:// or https:// for both domain and subdomain ?
Input - > http://www.example.com/
| Output -> www.example.com
Input - > http://site.example.com/
| Output -> site.example.com
Input - > example.com/
| Output -> www.example.com
I tried to use $_SERVER['SERVER_NAME']
but that's not working exactly.