Build a Simple REST API in PHP

July 24, 2018
REST API in PHP

We are expanding a  REST API in PHP Programming language and what is used or advantage of REST API.

What is Restful API?

Restful API is a Representational state transfer Application Programming Interface. If we are sending HTML requests in the server via  API sever give a piece of information in a JSON or XML form. Jason or XML why because those are structure data. It is using various types of HTTP Methods. GET,PUT,POST,DELETE.We are also using a SOAP. SOAP is a simple object access protocol.IT is also implementing web services and exchanging data information.RestAPI is most powerful and very fast. The most popular big company like Amazon, Google, Twitter, Yahoo using Restful API. API also used cloud services.


Step-1. Go to notepad++ or sublime then create a function.php page and save a page XAMPP or WampServer. the htdoc folder in XAMPP or www folder in WAMP on localhost.


Step-2. Create an index.php page and save a page XAMPP or WAMP server htdoc folder in XAMPP or www folder in WAMP on localhost.


 


OUTPUT-