This is odd, but for some reason the $_SERVER["SCRIPT_URI"]
will not return the domain name when I am in child/sub-pages but will only work on the main page. Not sure if its due to the script (WordPress) or host, but please can you suggest any reliable solution to retrieve the domain name with PHP?
If you need domain name, use:
$_SERVER['HTTP_HOST']
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With