Book Image

Learning PHP 7

By : Antonio L Zapata (GBP)
Book Image

Learning PHP 7

By: Antonio L Zapata (GBP)

Overview of this book

PHP is a great language for building web applications. It is essentially a server-side scripting language that is also used for general purpose programming. PHP 7 is the latest version with a host of new features, and it provides major backwards-compatibility breaks. This book begins with the fundamentals of PHP programming by covering the basic concepts such as variables, functions, class, and objects. You will set up PHP server on your machine and learn to read and write procedural PHP code. After getting an understanding of OOP as a paradigm, you will execute MySQL queries on your database. Moving on, you will find out how to use MVC to create applications from scratch and add tests. Then, you will build REST APIs and perform behavioral tests on your applications. By the end of the book, you will have the skills required to read and write files, debug, test, and work with MySQL.
Table of Contents (17 chapters)
Learning PHP 7
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Introducing APIs


API stands for Application Program Interface. Its goal is to provide an interface so that other programs can send commands that will trigger some process inside the application, possibly returning some output. The concept might seem a bit abstract, but in fact, there are APIs virtually in everything which is somehow related to computers. Let's see some real life examples:

  • Operating systems or OS, like Windows or Linux, are the programs that allow you to use computers. When you use any application from your computer, it most probably needs to talk to the OS in one way or another, for example by requesting a certain file, sending some audio to the speakers, and so on. All these interactions between the application and the OS are possible thanks to the APIs that the OS provides. In this way, the application need not interact with the hardware straight away, which is a very tiring task.

  • To interact with the user, a mobile application provides a GUI. The interface captures all...