Don't do it, at least not indiscriminately. You can redirect any request to PHP and do the parsing there. It's a tempting option, but it's horrible for performance because there's an expensive PHP process started for every request to every resource, including images, style sheets and so on.
Only when there is a lot of URL rewrites (like dozens, hundreds or thousands after a site move o restructuring) it may make sense to redirect them to a PHP script that does a database lookup. But even then you should know the basics of mod_rewrite in order to decide which requests to redirect to that script.
mod_rewrite is very finely documented, it just takes some getting into. I recommend at learning the basics.
One good resource to get started is this blog entry. There are numerous good questions on SO as well that are full of examples. The official docs are here.