라이브러리

[PHP] VtifulKernelExcel::data - VtifulKernelExcel 데이터




VtifulKernelExcel::data


VtifulKernelExcel::data는 PHP에서 Excel 파일을 생성, 수정, 삭제할 때 사용하는 클래스입니다. 이 클래스는 Excel 파일의 데이터를 관리하는 데 사용됩니다.

# 사용법


VtifulKernelExcel::data 클래스를 사용하기 위해서는 다음의 코드를 작성해야 합니다.

#hostingforum.kr
php

require 'vendor/autoload.php';

use PhpOfficePhpSpreadsheetSpreadsheet;

use PhpOfficePhpSpreadsheetWriterXlsx;



$spreadsheet = new Spreadsheet();

$sheet = $spreadsheet->getActiveSheet();

$data = new VtifulKernelExcelExcel($spreadsheet);



# 데이터 추가


VtifulKernelExcel::data 클래스의 `write()` 메서드를 사용하여 데이터를 추가할 수 있습니다.

#hostingforum.kr
php

$data->write(1, 1, 'Hello, World!');

$data->write(2, 1, 'This is a test.');



# 데이터 읽기


VtifulKernelExcel::data 클래스의 `read()` 메서드를 사용하여 데이터를 읽을 수 있습니다.

#hostingforum.kr
php

$data->read(1, 1);

$data->read(2, 1);



# 데이터 수정


VtifulKernelExcel::data 클래스의 `write()` 메서드를 사용하여 데이터를 수정할 수 있습니다.

#hostingforum.kr
php

$data->write(1, 1, 'Hello, World! (Modified)');

$data->write(2, 1, 'This is a test (Modified).');



# 데이터 삭제


VtifulKernelExcel::data 클래스의 `delete()` 메서드를 사용하여 데이터를 삭제할 수 있습니다.

#hostingforum.kr
php

$data->delete(1, 1);

$data->delete(2, 1);



# 예제


다음은 VtifulKernelExcel::data 클래스를 사용하여 Excel 파일을 생성, 수정, 삭제하는 예제입니다.

#hostingforum.kr
php

require 'vendor/autoload.php';

use PhpOfficePhpSpreadsheetSpreadsheet;

use PhpOfficePhpSpreadsheetWriterXlsx;

use VtifulKernelExcelExcel;



$spreadsheet = new Spreadsheet();

$sheet = $spreadsheet->getActiveSheet();

$data = new Excel($spreadsheet);



// 데이터 추가

$data->write(1, 1, 'Hello, World!');

$data->write(2, 1, 'This is a test.');



// 데이터 읽기

echo $data->read(1, 1) . "
";

echo $data->read(2, 1) . "
";



// 데이터 수정

$data->write(1, 1, 'Hello, World! (Modified)');

$data->write(2, 1, 'This is a test (Modified).');



// 데이터 삭제

$data->delete(1, 1);

$data->delete(2, 1);



// Excel 파일 생성

$writer = new Xlsx($spreadsheet);

$writer->save('example.xlsx');



이 예제에서는 VtifulKernelExcel::data 클래스를 사용하여 Excel 파일을 생성, 수정, 삭제하는 방법을 보여줍니다.
  • profile_image
    나우호스팅 @pcs8404 

    호스팅포럼 화이팅!

    댓글목록

    등록된 댓글이 없습니다.

  • 전체 8,985건 / 46 페이지

검색

게시물 검색