In order to facilitate multiple countries, each country will have a website URL as below:
I'm trying to extract the 2 character country code between the forwardslashes (it will always be 2 characters long). I'm guessing I need a Regexp but I have no idea how to use them.
In English, the pattern would be /XX/ where XX is what needs to be stored in a PHP variable. The position of the string /XX/ would not be fixed as I need this working using http://localhost/folder
as well as http://server/folder
Can somebody please provide some direction on how I can get started?
Thanks in advance