This code gives an URL for a QR Code, but I'm going to use it on the print version of the page, so I have to (preg_replace) remove 'print/' from the end of the url string, so the URL given, is for the non-print version. Please.
public function getPageUrl() {
$url = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
return $url;
}