I try to parse my Url to my Router Class.
For the begin all is clear i get my Url splitting it into a Array but my Problem at the moment is that i need to add my Routes first like $router->add("user/show/123"); or $router->add("article/2584/edit"); pushing them into a Array and request when its in Array then load Page. But i dont find a way to solve the Parameters when i add them to the Routes. How can i make it like $route->add("article/WHATEVER/edit"); so its loading the Page whatever the number is?
I guess with RegEx but iam not really good at it or understanding it. And have no Idea at the moment how to do it i already googled and searched but all i find are finished classes which i dont want to use cause i want to understand how it works at least.
I would be happy for some help some links and some Code Snippets which will give me a new Point of View and a way to go on.
article/\d+/editwould be any number in the middle, what does theadddo though? Does that take regex?