sadece excel olarak çıkartacaksanız
<?php
header('Content-Encoding: UTF-8');
header('Content-Type: text/plain; charset=utf-8');
header("Content-disposition: attachment; filename=dosya.xls");
echo "<table>
<table>
<tr bgcolor=red >
<th>Sütun 1</th><th>Sütın 2</th>
</tr>
<tr bgcolor=yellow ><td>içerik 1</td><td>içerik 2</td></tr>
</table>
";
?>bu işinize yarar