I would like get the last path segment in a URL:
http://blabla/bla/wce/news.phporhttp://blabla/blablabla/dut2a/news.php
For example, in these two URLs, I want to get the path segment: ‘wce’, and ‘dut2a’.
I tried to use $_SERVER['REQUEST_URI'], but I get the whole URL path.
Try:
Assuming
$tokenshas at least 2 elements.