Answer the question
In order to leave comments, you need to log in
How to put a php check (if) and check the content that is in the root of the site?
I have a site with different languages 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 content of the corresponding language?
Answer the question
In order to leave comments, you need to log in
<?php
$request_uri = explode('/', $_SERVER['REQUEST_URI'], 2);
switch ($request_uri[0]) {
case '/uk':
# code...
break;
case '/en_US':
# code...
break;
case '/ru_RU':
# code...
break;
default:
# code...
break;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question