컴퓨터관련

php 엑셀로 저장...펌

맘편한넘 2011. 3. 8. 17:50

<?php
 $title = speedmotors;
 header( "Content-type: application/vnd.ms-excel" );  
 header( "Content-Disposition: attachment; filename=". $title. ".xls");  
// $title 변수명으로 저장됩니다. 원하는 이름으로 바꾸세요
 header( "Content-Description: PHP4 Generated Data" ); 
?>
 
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<html>
<head>
<title></title>
</head>
<body>
 <table border=1>
  <tr>
   <td>주문번호</td>
   <td>판매량</td>
  </tr>
 
<?php for($i=0; $i<10; $i++){ ?>
  <tr>
   <td><?= $i ?></td>
   <td><?=$i+1 ?></td>
  </tr>
<?php } ?>
 
 </table>
</body>
</html>