I am trying to get the full url name for example
https://example.com/index.php?page=home
I use this code
$curPageName = substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
and this code
<a href="https://example.com/<?php echo $curPageName; ?>" title="Check this site in English">
Unfortunately the result comes out as
the rest or url "?page=home" is missing. How can I get this included? its not just only one page like ?page=home is has more pages. Do I miss something in substr($_SERVER["SCRIPTNAME"] ???