Created
July 11, 2022 12:51
-
-
Save someguy9/a2b5ed09596376e450a946473684213c to your computer and use it in GitHub Desktop.
Get current page URL with query string in PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url_parts = parse_url( home_url() ); | |
$current_url_with_query_string = $url_parts['scheme'] . "://" . $url_parts['host'] . add_query_arg( NULL, NULL ); | |
echo $current_url_with_query_string; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment