I have a path that is separated by forward slash.
$uri = getenv('REQUEST_URI');
$uri = explode('/', $uri);
$uri = array_filter($uri);
$uri = array_merge($uri, array());
The path would end up something like:
/user/john/account
This will grab the last word in the path, 'account'.
$uri = end($uri);
How can I get the first word found after 'user' into a variable?
In this case it would be 'john', but the name can change on every new URI.
'user' always stays the same word.