A
A
Alexander Tishchenko2020-05-24 14:18:23
PHP
Alexander Tishchenko, 2020-05-24 14:18:23

How to use a method as a parameter (id)?

Hello everyone)
I have a url like this " site.com/articles/bla-bla " The
URL is broken and as a result articles is a file. and bla-bla is a function from a file.
Everything works as it should. But how can I use the second segment of the site url as a parameter?
I want something like this: site.com/articles/($id)
Maybe in the .htaccess file (RewriteRule) set up before the line that redirects everything to "index.php"?
Thank you all in advance.
PS
Frameworks, etc. Do not offer.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shamanov, 2020-05-24
@Sasha_Odesskiy

https://github.com/nikic/FastRoute

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question