Answer the question
In order to leave comments, you need to log in
How to implement API requests in PHP?
Hello
It is necessary to write an API in PHP
Requests to create a post will be sent to /posts
To view each post posts/id
How can I implement such a search by ID
I don’t need to create a separate folder for each post? (And if there is no post?)
Tell me
____________
Resolved with the help of routing.
Answer the question
In order to leave comments, you need to log in
I don’t need to create a separate folder for each post? (And if there is no post?)
And I think the first step on how to do it most correctly and cool is to study php, computer networking theory, databases and technologies for creating a web server.
If there is an opportunity to get confused, then I advise you to learn Lumen or Laravel.
There such things are written not simply, but very simply. Of course, you will have to spend time to deal with the framework itself, but you will like the result.
https://github.com/coskunsoysal/rest-api-sample
Nice example on slim.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question