2024 日本 PHP 研討會

Vtiful\Kernel\Excel::insertText

(PECL xlswriter >= 1.2.1)

Vtiful\Kernel\Excel::insertTextVtiful\Kernel\Excel insertText

描述

public Vtiful\Kernel\Excel::insertText(
    int $row,
    int $column,
    整數 (int)|浮點數 (float)|字串 (string) $data,
    字串 (string) $format = ?
)

在儲存格中寫入文字。

參數

列 (row)

儲存格列數

欄 (column)

儲存格欄數

資料 (data)

要寫入的資料

格式 (format)

字串格式

回傳值

Vtiful\Kernel\Excel 實例

範例

範例 #1

<?php
$config
= [
'path' => './tests'
];

$excel = new \Vtiful\Kernel\Excel($config);

$file = $excel->fileName("free.xlsx")
->
header(['name', 'money']);

for (
$index = 0; $index < 10; $index++) {
$file->insertText($index+1, 0, 'viest');
$file->insertText($index+1, 1, 10000, '#,##0');
}

$textFile->output();
新增註記

使用者貢獻的註記

此頁面沒有使用者貢獻的註記。
To Top