如何使用mod_rewrite将URL重写为PHP数组?

I can't figure out how to rewrite an URL (using mod_rewrite) from the following form

https://example.com/foo/bar/123/asd/qwerty

to the following form

https://example.com/index.php?controller=foo&action=bar&params[]=123&params[]=asd&params[]=qwerty

There will always be a controller and action supplied, but the number of parameters after that may vary. I'm currently passing the entire 123/asd/qwerty as a string to $_GET['params'] in PHP, but I would now like to turn this string into an already split array instead.

What RewriteRule do I use?

I am not sure that what you need is a rewrite rule. What mod_rewrite is doing, when applied is leading from
A: https://example.com/foo/bar/123/asd/qwerty to B: https://example.com/index.php?controller=foo&action=bar&params[]=123&params[]=asd&params[]=qwerty

BUT : In the above case B is the original URL and A is the re-written one...which is just more user friendly. Since you do not pass a variable in URL you can not "GET" it something from it. I think the only way to do it is to grab the url and split it in parts using php