PHP code example of webchemistry / svatky

1. Go to this page and download the library: Download webchemistry/svatky library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

webchemistry / svatky example snippets


$names = WebChemistry\NameDay::getToday();

$names = WebChemistry\NameDay::getTommorrow();

$names = WebChemistry\NameDay::getYesterday();

$names = WebChemistry\NameDay::getByDateTime(new \DateTime('+ 1 month'));

$names = WebChemistry\NameDay::getByTimestamp(time() + (3 * 24 * 60 * 60));

$names = WebChemistry\NameDay::get(31, 12);

$date = WebChemistry\NameDay::getByName('Řehoř');

$name->getNames(); // Vrací pole jmen v daném měsíci, většinou jednoprvkový
(string) $name; // Převede jména/jméno na string, v případě, že se jedná o více jmen, tak jsou oddělené čárkou a mezerou tzn. ", " 

$date->getDay(); // Den jako int
$date->getMonth(); // Měsíc jako int
$date->toDateTime(); // Objekt DateTime s aktuálním rokem
$date->toTimestamp(); // Timestamp s aktuálním rokem
(string) $date; // String nejprve den, potom měsíc oddělené tečkou