Created
October 17, 2020 05:06
-
-
Save cp6/65deeb875e803c40a729cd555ab39ebe to your computer and use it in GitHub Desktop.
PHP build URL from GET paramaters
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 | |
$params = $_GET; | |
$count = 0; | |
foreach ($params as $key => $value) { | |
if ($count === 0) { | |
echo "?{$key}={$value}"; | |
} else { | |
echo "&{$key}={$value}"; | |
} | |
//echo "$key : $value<br>"; | |
$count++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment