DANNY:
bagaimana cara membuat file excel dengan php, setelah buka sana buka sini akhirnya aku menemukan cara termudah untuk membuat file excel dengan php. Berikut adalah contoh coding php yang mungkin bisa dikembangkan lagi.
Quote
Code:
<?php
header(“Cache-Control: no-cache, no-store, must-revalidate”);
header(“Content-Type: application/vnd.ms-excel”);
header(“Content-Disposition: attachment; filename=namaFile.xls”);
//isi file excel (pakai tabel)
$asia = array(“Indonesia”, “Malaysia”, “Philipine”, “Brunai”, “Thailand”, “Laos”, “Vietnam”, “Timor Leste”);
echo “<table border=”1″>
<tr>
<td>No</td>
<td>Negara</td>
<td>Ket</td>
</tr>”;
$no = 1;
for($i=0; $i<count($asia); $i++)
{
if($i%2==0)
$b = “red”;
else
$b = “”;
echo “<tr>
<td bgcolor=”.$b.”>”.$no.”</td>
<td bgcolor=”.$b.”>”.$asia[$i].”</td>
<td bgcolor=”.$b.”>-</td>
</tr>”;
$no++;
}
echo “</table>”;
//bisa juga pakai Xml
?>
Atau dowload aja file nya Quote
Code:
http://aqlpgw.bay.livefilestore.com/y1pysGZ6zOKpBHQk8fRqyG6smTl7P5wacYp1Gvps7O6yb6dInzOGKC3meFbuCSLYvhNSZ1qgtB1p5NHoexNd62RyA/excel.php?download
sumber