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.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -