웹개발/PHP

php 엑셀파일로 데이터 저장하기

광박이 2009. 8. 31. 18:05
728x90
다음과 같은 구문을 추가하면

$filename="account_" . date('Y_m_d(H i)');
header( "Content-type: application/vnd.ms-excel" );
header( "Content-Disposition: attachment; filename=$filename.xls" );
header( "Content-Description: PHP4 Generated Data" );

PHP 파일의 데이터를 엑셀로 저장할 수 있다.
위의 코드를 빼주면 PHP를 웹에서 사용하는 것과 같다.
728x90