We created a basic RESTful web service and provided basic CRUD operations. However, there are a lot of issues in the current code which we will see and address in the next chapters.
We have written PHP code to create a basic RESTful web service in this chapter, though it is not the best way to do it--this is just to give you a direction. Here are some resources from where you can learn to write better PHP code. This is a quick reference for PHP best practices: http://www.phptherightway.com/.
To adopt the standard coding style and practice, you can read PHP coding standards and style at http://www.php-fig.org/.
I recommend that you spend some time on these two URLs so that you can write better code.
In the next chapter, we will look into this in detail and will identify different flaws in this code including security and design flaws. And also, look at different solutions...