PHP kullanarak Regex ile URL Ayrıştırma

0 Cevap php

Böyle biçimlendirilmiş bir url var:

http://www.example.com/detail/state-1/county-2/street-3

What I'd like to do is parse out the values for state (1), county (2), and street (3). I could do this using a combination of substr(), strpos(), and a loop. But I think using a regex would be faster however I'm not sure what my regex would be.

0 Cevap