$_SERVER['REQUEST_URI']
дает вам все после вашего домена и тдл.Например, $_SERVER['REQUEST_URI']
в example.com/test
приведет к /test
.
Зная это, вы можете удалить первую часть вашей строки следующим образом: # Ваш URL $ url = 'http://example.com/uk/test/some/more';
# Fetch the uri
//$request_uri = $_SERVER['REQUEST_URI'];
$request_uri ='/uk/test/some/more';
# Split the uri into an array
$request_uri_array = explode('/', $request_uri);
# Unset `uk`, which is the second element in the array
unset($request_uri_array[1]);
# Re-assemble the array into a string
$fixed_uri = implode('/', $request_uri_array);
echo $fixed_uri;
Обратите внимание, что это только примерный подход