How to make a regex expression?

A url from $_SERVER["REQUEST_URI"]:

1. Home,, and so on.
2. Inner pages, and so on

You need to cut the name of the language given the fact that you can add new locale 3 letter or 4 letter.

Thought that solved the problem pattern ~\/(.*)\/|\/\w{1,4}~, but it was not there.

Help make Virginia.

The result should be: -> / -> / -> account -> account/edit
June 10th 19 at 15:12
3 answers
June 10th 19 at 15:14
June 10th 19 at 15:16
June 10th 19 at 15:18

Find more questions by tags Regular expressionsPHP