1.Ê×ÏÈ»áʹÓà phpÖеÄheader()µÄÓ÷¨
ÕâÀï¿ÉÒԲο¼w3schoolÖеÄPHP header() º¯ÊýºÍp
ÔÚÈκÎʵ¼ÊµÄÊä³ö±»·¢ËÍ֮ǰ¶¼Òªµ÷Óà header() º¯Êý¡£
ÏÂÃæ¾ÍÒÔphpÊä³öcsvÀý¡£
1.¶¨Òåheader()Í·²¿Êä³ö¸ñʽ
header("Content-type:application/vnd.ms-excel"); //¶¨ÒåÊä³öµÄÎļþÀàÐÍ
header(¡°content-Disposition:filename=downloaded.pdf
¡±); //¶¨ÒåÊä³öµÄÎļþÃû£¬Ò²¾ÍÊÇÉèÖÃÒ»¸öÏÂÔØÀàÐÍ£¬ÏÂÔصÄʱºò¶ÔÎļþ´ÓÐÂÃüÃû
<?php header("Content-type:application/vnd.ms-excel"); header("content-Disposition:filename=downloaded.pdf "); echo"1\t 2\t 3\n"; //ÆäÖÐ \t ÊÇ¿Õ°× ,\nÊǻسµ (±àÂë¹æ·¶ ²»ÄÜÖ±½ÓÊä³ö) echo"1\t 2\t 3\n"; echo"1\t 2\t 3\n"; ?>
Õâʱºò¾Í¿ÉÒÔ´ò¿ªÕâ¸öphpÎļþ,¾Í»áÌáʾÏÂÔØ¡£
Ò²¿ÉÒÔÒÔtable±í¸ñµÄ·½Ê½Êä³ö£»
<?php header("Content-type:application/vnd.ms-excel "); header("content-Disposition:filename=downloaded.pdf"); ?> <table> <tr> <td>t00</td><td>t01</td><td>t02</td> </tr> <tr> <td>t10</td><td>t11</td><td>t12</td> </tr> <tr> <td>t20</td><td>t21</td><td>t22</td> </tr> </table>
CSVµÄдÈë²Ù×÷£º
$fp = fopen('f:/file.csv', 'w'); fputcsv($fp,array('aaa','bbb','cccc')); fputcsv($fp,array('mmm','yyy','haha')); //fputcsv()¿ÉÒÔÓÃÊý×éÑ»·µÄ·½Ê½½øÐÐʵÏÖ fclose($fp);
ÍƼöÐÅÏ¢
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- php³£ÓÃÕýÔò±í´ïʽ
- phpÐÔÄܼà²âÄ£¿éXHProf
- ÈÃCI¿ò¼ÜÖ§³Öservice²ã
- ʹÓÃPHPÉú³É´øLOGOµÄ¸öÐÔ»¯¶þάÂëͼÏñ
- ¹ØÓÚCodeIgniterÄã¿ÉÄܲ»ÖªµÀµÄ5¸ö֪ʶµã
- Memcache ºÁÃ뼶³¬Ê±¼°ÆäËû³£¼ûÎÊÌâ»ã×Ü
- [PHP±Ê¼Ç]PHPQueryÒ»¸ö´¦ÀíDOMµÄÀûÆ÷
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- PHP»ñÈ¡Óû§µÄÕæʵIP£¬²¢ÅжÏÊÇ·ñÄÚÍøIP
- PHP ´íÎóÈÕÖ¾ error_log
- ÀûÓÃbigpipe»úÖÆʵÏÖÒ³ÃæÄ£¿éµÄÒì²½äÖȾ chunked¼¼Êõ
- php¿ØÖÆÎļþÏÂÔØËÙ¶È
- js + php ¶ÁÈ¡¡¢²¥·ÅÊÓƵÁ÷ ¼æÈÝfirefox£¬c....
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- UNICODE Óë UTF-8 µÄ¹Øϵ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- phpʹÓÃmb_detect_encoding¼ì²â×Ö·û´®±àÂë
ÆÀÂÛ