I'd like to be able to extract certain aspects of a URL, based on a pattern:
http://www.mywebsite.com/{type}-for-sale-in-{district}/{id?}
In this case, I need to be able to extract the parts within the curly braces above. This was inspired by Laravel routing, and will always be the pattern.
Initially I was thinking of somehow doing this with .htaccess, but I'd rather just process the values right on the page with PHP.