Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Tuyệt Kỹ Đong Giai Chân Kinh (tuyệt Kỹ cua trai)
Thu Aug 23, 2012 5:38 am by Admin

» Tuyệt kỹ cua giai
Thu Aug 23, 2012 5:36 am by Admin

» NETCAT.........
Mon Aug 13, 2012 6:35 am by Admin

» Bảo mật CSDL bằng phương pháp mã hóa.
Tue Apr 17, 2012 10:04 pm by Admin

» Hàm mã hóa MD5 bằng JavaScript
Tue Apr 17, 2012 10:03 pm by Admin

» Giá của món quà
Fri Apr 13, 2012 6:01 am by Admin

» Sẽ chỉ yêu ai?
Fri Apr 13, 2012 6:01 am by Admin

» Cách đọc bảng chữ cái!
Thu Apr 12, 2012 10:37 pm by Admin

» Gắn trojan, keylog, virus vào website, forum
Tue Apr 10, 2012 1:14 am by Admin

Shopmotion


Affiliates
free forum


Xuất dữ liệu ra dạng Excell từ PHP

Go down

Xuất dữ liệu ra dạng Excell từ PHP

Post  Admin on Thu Jun 09, 2011 3:22 am

<?
function xlsBOF() {
echo pack("ssssss", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);
return;
}

function xlsEOF() {
echo pack("ss", 0x0A, 0x00);
return;
}

function xlsWriteNumber($Row, $Col, $Value) {
echo pack("sssss", 0x203, 14, $Row, $Col, 0x0);
echo pack("d", $Value);
return;
}

function xlsWriteLabel($Row, $Col, $Value ) {
$L = strlen($Value);
echo pack("ssssss", 0x204, 8 + $L, $Row, $Col, 0x0, $L);
echo $Value;
return;
}
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");;
header("Content-Disposition: attachment;filename=php2xls.xls "); // แล้วนี่ก็ชื่อไฟล์
header("Content-Transfer-Encoding: binary ");

// XLS Data Cell

xlsBOF();
xlsWriteLabel(1,0,"PHP Group VN");
xlsWriteLabel(2,0,"Website : ");
xlsWriteLabel(2,1,"http://phpbasic.com");
xlsWriteLabel(3,0,"TITLE : ");
xlsWriteLabel(3,1,"Dien dan thao luan PHP");
xlsWriteLabel(4,0,"Copyright @ ");
xlsWriteLabel(4,1,"PHP Group VN");
xlsWriteLabel(6,0,"NO");
xlsWriteLabel(7,0,"1");
xlsWriteLabel(6,1,"ID");
xlsWriteLabel(7,1,"2104");
xlsWriteLabel(6,2,"Gender");
xlsWriteLabel(7,2,"Male");
xlsWriteLabel(6,3,"Name");
xlsWriteLabel(7,3,"TG");

xlsEOF();
?>
avatar
Admin
Admin

Tổng số bài gửi : 782
Join date : 2009-08-15

View user profile http://hackis.forumvi.com

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum