url_origin()
url_origin(array $s = false, boolean $use_forwarded_host = false) : string
Get the actual absolute origin of the request sent by the user.
Parameters
array | $s | The $_SERVER variable contents. Defaults to $_SERVER. |
boolean | $use_forwarded_host | Whether to utilise the X-Forwarded-Host header when calculating the actual origin. |
Returns
string —The actual origin of the user's request.