Common
Animals
Fish
Mushrooms
Flora
Login
Registration
Back

Name of the month

Register and receive a token to access the API. The token will be available in your personal account.
Demo token 93a1f6fc-3fa2-40ee-9fae-0ff301df50f0 (The token is valid on average for about three days).
The code displays the names of the months in different languages.
In the line echo $data['English']['month']; change English to the desired language provided above in the comments.
Don't forget to change the demo token to yours.
<?php
// We get the current day of the week number
$currentMonthNumber = date('n');

// $currentMonthNumber = 1; // January
// $currentMonthNumber = 2; // February
// $currentMonthNumber = 3; // March
// $currentMonthNumber = 4; // April
// $currentMonthNumber = 5; // May
// $currentMonthNumber = 6; // June
// $currentMonthNumber = 7; // July
// $currentMonthNumber = 8; // August
// $currentMonthNumber = 9; // September
// $currentMonthNumber = 10; // October
// $currentMonthNumber = 11; // November
// $currentMonthNumber = 12; // December


// Demo token. (Replace it with your token).
$token = '93a1f6fc-3fa2-40ee-9fae-0ff301df50f0';

// Form the URL using the token and day of the week
$url = 'https://wildtracks.pro/api/name_of_months/' . $token . '/' . $currentMonthNumber;

// Initializing cURL
$ch = curl_init();

// cURL Settings
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Executing the request
$response = curl_exec($ch);

// Checking for errors
if (curl_errno($ch)) {
    die('cURL error: ' . curl_error($ch));
}

// Closing the cURL session
curl_close($ch);

// Decoding the JSON response
$data = json_decode($response, true);

// Checking for decoding errors
if (json_last_error() !== JSON_ERROR_NONE) {
    die('Error decoding JSON: ' . json_last_error_msg());
}

// Chinese
// Spanish
// English
// Hindi
// Arab
// Bengal
// Portuguese
// Russian
// Japanese
// Lahnda
// Marathi
// Telugu
// Malay
// Turkish
// Korean
// French
// German
// Vietnamese
// Tamil
// Urdu
// Javanese
// Italian
// Persian
// Gujaratis


// Output name of the month in English
echo $data['English']['month'];
// echo $data['English']['lang']; //Language
// echo $data['English']['country']; //Country
// echo $data['English']['code']; //Country code
// echo $data['English']['transcription']; //Transcription of the name of the month

?>

Description of fields:
langLanguage
countryCountry
codeCountry code
monthName of months
transcriptionTranscription of the name of the month