6
6
6a6ajka2018-11-09 08:52:02
PHP
6a6ajka, 2018-11-09 08:52:02

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

3 answer(s)
L
l4m3r, 2018-11-09
@6a6ajka

I don’t need to create a separate folder for each post? (And if there is no post?)

Or maybe it's programming?

U
Uno, 2018-11-09
@Noizefan

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.

A
Alexander Filippenko, 2018-11-09
@alexfilus

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 question

Ask a Question

731 491 924 answers to any question