How to match this directory?

URL: ```
site.com/buscar-pareja/malaga_r


How can I match "buscar-pareja" in this URL which can be a different name depending on the url?

PS. I would like to match what comes after **site.com/match/**

I am not quite sure what you are asking but breaking down the URL:
site.com = domain
buscar-pareja = A folder
malaga_r = possibly another folder inside buscar-pareja or a file that has had the extension removed inside buscar-pareja

get position of the first slash with strpos(), then apply substr(), maybe you can use parse_url()

Or explode() into an array by / and pick out the sections you need.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.