Mine
public php v1 · immutablefunction sg_get_uri(){ if ($_SERVER["SERVER_PORT"] == 443) { $server_protocol = "https"; } else { $server_protocol = "http"; } return $server_protocol.'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];}