I need to detect the language the user is using to include the correct file using PHP if elseif or else like this:
users are comming from:
example.com/EN/nice-title-url-from-database-slug
example.com/DE/nice-title-url-from-database-slug
example.com/ES/nice-title-url-from-database-slug
the php I need is something like this:
PHP document.location.toString().split(...) etc detect the url paths
if url path <starts with /DE/>
include de.php
elseif url <path starts with /EN/>
include en.php
else url <path starts with /ES/>
include es.php
so what I need is to detect the url after the domain (/ES/ or /EN/ or /DE/)
Any idea how to achieve this?