API With a Single URL in PHP
Let's warm up by creating an API with a single address that can be requested. Let this address be the following:
http://api.loc/index.php
For example, let our API
return a random number from 1 to 100 when accessing the address:
<?php
echo mt_rand(1, 100);
?>
Create an API that will return the current time in the hours-minutes-seconds format.