I need some help with a PHP based path parser, I am trying to create a path router that grabs arguments form the given string and returns an keyed array containing the results. I can do it inside of a whole loop where each area is broken down and tested seperatly but I feel that there should be a way to do it as a signaler regex that then loops though the results
users/<id:(\d+)>/ = users/1 || users/42 != users/bob
returns args['id'] = 1 || args['id'] = 42
user/register
args = []
name/<fname:([a-zA-Z]{1,10})>/<lname:([a-zA-Z]{1,10})> = name/bob/smith || name/jordan/freeman
args['fname'] = bob || args['fname'] = jordan
args['lname'] = smith || args['lname'] = freeman
explode()would likely be much faster.