View difference between Paste ID: D821VkND and NgAakcj1
SHOW: | | - or go back to the newest paste.
1
<?php
2
ob_start("callback");
3
$s='';
4
if($_GET['xls']){
5
	header('Content-type: application/vnd.ms-excel');
6
}else{
7
	$s.="<a href='?xls=down'>klik untuk buka dalam bentuk excel</a>";
8
}
9
10
function callback($buffer)
11
{
12
  
13
  return trim( $buffer) ;
14
}
15
16
 
17
/*
18
jalankan dahulu lalu klik linknya.. dan liat BEDANYA
19
*/
20
21
22
$s.="<table>";
23
for($i=0;$i<5;$i++)
24
{
25
   $s.="\n<tr>";
26
	for($j=0;$j<3;$j++)
27
	{
28
	   $p=$i*120+$j+5;
29-
	    $s.="\n\t<td>".$p."</td>";
29+
	    $s.=td($p);
30
	}
31
   $s.="\n</tr>";
32
}
33
$s.="</table>";
34
 
35
print $s;
36-
ob_end_flush();
36+
ob_end_flush();
37
38
function td($s="nbsp;"){
39
	return "\n\t<td valign=top>".trim($s)."</td>";
40
}