Hi,
I trying to come up with an easy solution to change a specific parameter in the URL.
Example of URL format:
I want to be able to change the "lang" parameter.
FYI: The lang param is not always last in the URL.
I guess this could be handled with a Regex ?
I trying to come up with an easy solution to change a specific parameter in the URL.
Example of URL format:
Code:
[URL unfurl="true"]http://www.domain.com/dir/script.php?id=343&view=y&lang=russian[/URL]
I want to be able to change the "lang" parameter.
FYI: The lang param is not always last in the URL.
I guess this could be handled with a Regex ?
Code:
$NEW_LANG = 'english';
$URL_STRING = $_SERVER['QUERY_STRING'];
... Regex to change lang value by $NEW_LANG ...
$NEW_URL_STRING = $_SERVER['SCRIPT_NAME'] . "?" . $URL_STRING;