Çë½ÌÒ»¸öphpµ¼³öexcelµÄÎÊÌâ
ÏÂÃæÊÇtest.htmlµÄÒ»¶Î´úÂ룬ΪʲôִÐÐtest1()£¬ÌáʾÏÂÔØexcelÎļþ£¬¶øtest2()´ò¿ªexcelexport.phpÖ®ºó£¬Ã»ÓÐÌáʾ±£´æ¾Í×Ô¶¯¹Ø±ÕÁË£¿
HTML code:
<input type="button" value="btn1" onclick="test1()"/>
<input type="button" value="btn2" onclick="test2()"/>
<script language="javascript" type="text/javascript">
function test1() {
window.open("excelexport.php");
}
function test2() {
window.setTimeout(test1,1);
}
</script>
excelexport.phpµÄ´úÂë:
PHP code:
<?php
header("Content-Type:application/force-download");
header("Content-Type:application/vnd.ms-execl");
header("Content-Type:application/octet-stream");
header("Content-Type:application/download");
header('Content-Disposition:attachment;filename="charging.xls"');
header("Content-Transfer-Encoding:binary");
?>
ллÁ½Î»£¬µ«ÊÇÓÃÄãÃǵķ½·¨£¬ÎÊÌ⻹ÊÇ´æÔÚ
µ¯³öµÄд°¿ÚÒ»ÉÁ¾ÍÏûʧÁË£¬Ã»ÓÐÌáʾÏÂÔØ
ÄãÃ÷°×setTimeout µÄÒâ˼Â𣿽¨ÒéÄãºÃºÃ¿´¿´ÊÖ²áÉÏÊÇÔõô˵µÄ
window.setTimeout(vCode, iMilliSeconds [, sLanguage])
ÎÒÀí½âÊ
Ïà¹ØÎÊ´ð£º
1.¾«Í¨ÃæÏò¶ÔÏóµÄÉè¼ÆºÍ¿ª·¢£»
2.ÊìÁ·Ê¹ÓÃPHPÓïÑÔ(5.0+)½øÐÐÊý¾Ý¿â£¬ÍøÂçͨÐÅ£¬Îļþ¶Áд£¬°²È«»úÖÆµÈ¿ª·¢£»
3.ÊìÁ·Ê¹ÓÃMYSQL(5.0+)Êý¾Ý¿â¿ª·¢£¬°üÀ¨»ù±¾µÄÊý¾Ý¿âÉè¼Æ/ÓÅ»¯/°²È«£¬¸´ÔÓµÄT-SQLÓï¾ä±àд£¬ÊìÁ·±àдMYS ......
¹ýÍêÄêҪȥÎ人ÁË£¬ÏëÁ˽âÒ»ÏÂPHPÅàѵ±È½ÏÕý¹æ?
Ŷ ¶ÔÁË£¬»¹ÓУ¡PHPÊÖ²á±ØÐëµÃŪһ¸ö
àÅ ÌìÌìÔÚ¿´Ê¥¾£¨Ò»ÌìÒ²¾ÍÖ»ÄÜ¿´¸ö¶þʮҳ£©£¬PHP100ÊÓÆµ½Ì³Ì¿´ÁË33½²ÁË£¨Ò»ÌìÒ²Ö»¿´Ò»½²£©
ÎÒ»á¼á³Ö°ÑÕâ±¾ÊéºÍÊÓÆµ¸ã¶¨ ......
ÇëÎÊ£¬ÒÔÏ´úÂ룬Ϊʲô²»¹ÜÓ㿾Ístr_replaceÕâ¸öº¯Êý£¬Ì滻ôÓÐÆð×÷Óã¿
PHP code:
$gg='<script type=\"text/JavaScript\">
alimama_pid=\"mm_14281022_2030060_8250750\";
alima ......
°²×°ÁËAPHACHE
¿ÉÊÇÔËÐÐÍøÒ³Ê²Ã´¶¼Ã»ÓÐ
¼±
»¹ÏëÇëÎÊÏÂ,JSP.PHP.ASP.NET ÄǸö¹¤×ʸ߰¡,
»ØÌû¾Í¼Ó·Ö
»¹Òª×°php5
×öµÃºÃ£¬Äĸö¹¤×ʶ¼¸ß¡£
http://download.csdn.net/source/1712990 Õâ¸öÀïÃæÓÐÕû¸öPHPµÄ° ......
index.phpÄÚÈÝ£º
$smarty->assign('name',strtotime('-0'));
$smarty->display("index.html");
index.htmlÄÚÈÝ£º
{$name|date_format:'%Y-%m-%d'}<hr>
{$ ......