What's the best way to implement a URL interpreter / dispatcher, such as found in Django and RoR, in PHP?
It should be able to interpret a query string as follows:
/users/show/4
maps to- area = Users
- action = show
- Id = 4
/contents/list/20/10
maps to- area = Contents
- action = list
- Start = 20
- Count = 10
/toggle/projects/10/active
maps to- action = toggle
- area = Projects
- id = 10
- field = active
Where the query string can be a specified GET / POST variable, or a string passed to the interpreter.
Edit: I'd prefer an implementation that does not use mod_rewrite.
Edit: This question is not about clean urls, but about interpreting a URL. Drupal uses mod_rewrite to redirect requests such as http://host/node/5 to http://host/?q=node/5. It then interprets the value of $_REQUEST['q']. I'm interested in the interpreting part.