regex - How to extract next url of base URL from a string in regular expression in php? -
for example :
http://www.baseurl.com/sports/what-sports/sportsname-golf/golf/mini-golf/menu
or :
http://www.baseurl.com/dance/what-dnace/dnacename-dhupodi/menu
i'd get:
dance
or
sports
here code :
$router->map('get','/[*:submenu]/menu','kisornirutest/index.php','submenu');
by way i'm getting result result either sports/what-sports/sportsname-golf/golf/mini-golf
or dance/what-dnace/dnacename-dhupodi
want pick sports
or dance
. i've done searching on this, didn't expected result.
i use class routing : http://altorouter.com/
if use php library manipulate urls
like :
http://url.thephpleague.com/3.0/
it did want several project.