Hi everyone! I'm the author of code.mu :)
I'd love to chat with my non-Russian audience. I'm looking for your feedback on the site and the translation quality. Let's chat:)
⊗ppSpAiMU 42 of 83 menu
◀ ▶

API Multiple URLs in PHP

Let's now create an API that will have several URLs for access. For example, let's assume the following set of addresses is available:

http://api.loc/hour.php http://api.loc/min.php http://api.loc/sec.php

Accessing the first address should return the current hour:

<?php echo date('H'); ?>

Accessing the second address returns the current minutes:

<?php echo date('i'); ?>

Accessing the third address returns the current seconds:

<?php echo date('s'); ?>

Create an API with three URLs. Accessing the first one should return the current day, the second one - the current month, the third one - the current year.

← →
↑
English▼
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline