Yak to put the test php (if) and check the contents of what is in the site root?

I have a website with different jazikami Rus, en, ua
how to check what is after the domain
for example
www.mysite.ru/uk/
www.mysite.ru/en_US/
www.mysite.ru/ru_RU/
to display the contents of the appropriate language?
June 7th 19 at 14:47
2 answers
June 7th 19 at 14:49
<?php
$request_uri = explode('/', $_SERVER['REQUEST_URI'], 2);

switch ($request_uri[0]) {
 case 'uk':
 # code...
break;

 case '/en_US':
 # code...
break;

 case '/en_us':
 # code...
break;

default:
 # code...
break;
}</property-->
June 7th 19 at 14:51
$uri = trim($_SERVER['REQUEST_URI'], '/');
switch($uri) {
 case 'uk':
 # Your code
break;
 case 'en_US':
 # Your code
break;
 case 'ru_RU':
 # Your code
break;
}

Find more questions by tags PHP