PHP code example of ponponumi / calendar_create

1. Go to this page and download the library: Download ponponumi/calendar_create 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/ */

    

ponponumi / calendar_create example snippets



Ponponumi\CalendarCreate\CalendarCreate;

$cal = new CalendarCreate(2026, 1); // 2026年1月、デフォルトは日曜開始
$cal->headerSet('ja'); // ヘッダーを日本語(短)に設定

// BOM付きUTF-8 CSV を取得
$csv = $cal->csvCreateBOM();
file_put_contents('calendar_utf8_bom.csv', $csv);

// Shift-JIS CSV を取得
$csv_sjis = $cal->csvCreateShiftJIS();
file_put_contents('calendar_sjis.csv', $csv_sjis);

public function __construct(int $year, int $month, ?int $startDay = null)

$cal = new CalendarCreate(2026, 1, 1); // 2026年1月、月曜開始
$cal->headerSet('ja-full');
$data = $cal->calendarDataCreate();
// $data はヘッダー行(設定していれば)と各週ごとの配列を含む
print_r($data);