XMLのエクスポート
PHPが配列データからXMLを生成し、ファイルとしてダウンロードします。
やっていること
- 配列(例:レッスン一覧) → DOMDocumentでXML生成
- Content-Typeを
application/xmlにする - Content-Dispositionで添付ダウンロード
※ サンプルの固定データを出力しています(後でDB/JSONに差し替えOK)。
生成例(イメージ)
<items generated="2026-02-07T..." source="sunstripe.programming.xml">
<item id="1">
<title>...</title>
<category>...</category>
<description>...</description>
<url>...</url>
<created>...</created>
</item>
</items>