I want to have URLs like: -
URL 1 - www.projectname/module/search/param/1
URL 2 - www.projectname/param/1/module/search
I need a PHP code that takes the above URLs as a parameter and returns an array like
Array("module" => "search", "param" => 1) (for URL 1)
Array("param" => 1, "module" => "search") (for URL 2)
So, I can use the result as $ _GET in my project. I found out that it would be better and easier to do this with PHP than with the htaccess rewrite rules. If you can also help with rewriting rules, please help.
There can be any number of parameters.
I got this idea from the CodeIgniter URL Processing Library. But my project is not on Codeigniter, so I can not use this library. Any separate code for this?
Thanks in advance