<?php
$filename = 'test.xls';
header("Content-type: application/vnd.ms-excel" );
header("Content-Disposition: attachment; filename=".$filename);
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<table>
<tr>
<td>하나</td>
<td>둘</td>
</tr>
<?php for($i=0; $i<10; $i++){ ?>
<tr>
<td><?php echo $i ?></td>
<td><?php echo $i+1 ?></td>
</tr>
<?php } ?>
</table>
</body>
</html>
'PHP' 카테고리의 다른 글
숫자형 출력시 지수로 표현할 자릴수 설정 (0) | 2015.03.19 |
---|---|
엑셀변환시 숫자를 텍스트형식으로 고정하기. (0) | 2014.11.03 |
폴더를 출력하기. (0) | 2013.01.22 |
부동소수점에 의해 ceil, floor 의 결과값이 기대와 다를수 있다. (0) | 2013.01.11 |
배열중 값이 없는 키를 제거한다. (0) | 2012.10.06 |