php ²»ÓÃCOM Éú³ÉexcelÎļþ
ÓÃphpÉú³ÉexcelÎļþ
<?
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=test.xls");
echo "test1/t";
echo "test2/t/n";
echo "test1/t";
echo "test2/t/n";
echo "test1/t";
echo "test2/t/n";
echo "test1/t";
echo "test2/t/n";
echo "test1/t";
echo "test2/t/n";
echo "test1/t";
echo "test2/t/n";
?>
¡¡¡¡ÔÚphp»·¾³ÔËÐÐÉÏÃæµÄ´úÂ룬´ó¼Ò¾Í¿ÉÒÔ¿´µ½ä¯ÀÀÆ÷ѯÎÊÓû§ÊÇ·ñÏÂÔØexcelÎĵµ£¬µã»÷±£´æ£¬Ó²ÅÌÉϾͶàÁËÒ»¸öexcelµÄÎļþ£¬Ê¹ÓÃexcel´ò¿ª¾Í»á¿´µ½×îÖյĽá¹û£¬ÔõôÑù²»´í°É¡£
¡¡¡¡ÆäʵÔÚ×öÕæÕýµÄÓ¦ÓõÄʱºò£¬´ó¼Ò¿ÉÒÔ½«Êý¾Ý´ÓÊý¾Ý¿âÖÐÈ¡³ö£¬È»ºó°´ÕÕÿһÁÐÊý¾Ý½áÊøºó¼Ó/t,ÿһÐÐÊý¾Ý½áÊøºó¼Ó/nµÄ·½·¨echo³öÀ´£¬ÔÚphpµÄ¿ªÍ·ÓÃheader("Content-type:application/vnd.ms-excel");±íʾÊä³öµÄÊÇexcelÎļþ£¬ÓÃheader("Content-Disposition:filename=test.xls");±íʾÊä³öµÄÎļþÃûΪtext.xls¡£ÕâÑù¾ÍokÁË¡£
¡¡¡¡ÎÒÃǸü¿ÉÒÔÐÞ¸ÄheaderÈÃËûÊä³ö¸ü¶à¸ñʽµÄÎļþ£¬ÕâÑùphpÔÚ´¦Àí¸÷ÖÖÀàÐÍÎļþ·½Ãæ¾Í¸ü¼Ó·½±ãÁË£®
Ïà¹ØÎĵµ£º
º¯ÊýµÄÒýÓ÷µ»Ø
ÏÈ¿´´úÂë ¸´ÖÆPHPÄÚÈݵ½¼ôÌù°å
PHP´úÂë:
function &test()
{
static $b=0;//ÉêÃ÷Ò»¸ö¾²Ì¬±äÁ¿
$b=$b+1;
echo $b;
return $b;
}
$a=test();//ÕâÌõÓï¾ä»áÊä³ö¡¡$bµÄÖµ¡¡Îª£±
$a=5;
$a=test();//ÕâÌõÓï¾ä»áÊä³ö¡¡$bµÄÖµ¡¡Îª2
$a=&test();//ÕâÌõÓï¾ä»áÊä³ö¡¡$bµÄÖµ¡¡Îª3
$a=5;
$a=test( ......
{Ò»}PHPÖÐthis,self,parentµÄÇø±ðÖ®Ò»thisƪ
ÃæÏò¶ÔÏó±à³Ì(OOP,Object Oriented Programming)ÏÖÒѾ³ÉΪ±à³ÌÈËÔ±µÄÒ»Ïî»ù±¾¼¼ÄÜ¡£ÀûÓÃOOPµÄ˼Ïë½øÐÐPHPµÄ¸ß¼¶±à³Ì£¬¶ÔÓÚÌá¸ßPHP±à³ÌÄÜÁ¦ºÍ¹æ»®web¿ª·¢¹¹¼Ü¶¼ÊǺÜÓÐÒâÒåµÄ¡£
PHP5¾¹ýÖØдºó£¬¶ÔOOPµÄÖ§³Ö¶îÓÐÁ˺ܴóµÄ·ÉÔ¾£¬³ÉΪÁ˾߱¸ ......
ASPÊÇ΢Èí¹«Ë¾ÊµÏÖ¶¯Ì¬ÍøÒ³µÄÒ»ÖÖ¼¼Êõ¡£
ASPÖ§³ÖһЩ½Å±¾ÓïÑÔ£¬Ö÷ÒªÒÔVBScriptΪÖ÷¡£
ÓëASPÏà±È½Ï£¬Ä㻹¿ÉÒÔÑ¡ÔñÁíÒ»Öпª·ÅÔ´´úÂë±à³ÌÓïÑÔ——PHP£¬PHP¿ÉÒÔÔËÐÐÔÚ¶àÖÖ²Ù×÷ϵͳÏ£¬ÆäÖаüÀ¨LinuxºÍwindows¡£
ËäÈ»ASPÊÇÒ»ÖÖ²»´íµÄ¼¼Êõ£¬µ«´Ó³¤Ô¶¿¼ÂÇÎÒÏàÐÅPHPÔÚ½«À´µÄ¼¼ÊõÁìÓòÀï»áÓв»·²µÄ±íÏÖ¡£
ÎÒÈÏΪÓÐÆ߸ ......
<?php
//¶¨ÒåÒ»¸öÊý×é
$arr = array(0=>"zero", 1=>"one", 2=>"two");
//ʹÓõÚÒ»ÖÖ·½·¨¶ÔÊý×é½øÐбéÀú
foreach ($arr as $value) {
echo "Value: $value; ";
}
echo "<BR>";&nb ......
ÔÚphpÖмÆËãʱ¼ä²îÓÐʱºòÊǼþÂé·³µÄÊÂ!²»¹ýÖ»ÒªÄãÕÆÎÕÁËÈÕÆÚʱ¼äº¯ÊýµÄÓ÷¨ÄÇÕâЩҲ¾Í±äµÄ¼òµ¥ÁË:
Ò»¸ö¼òµ¥µÄÀý×Ó¾ÍÊǼÆËã½èÊéµÄÌìÊý,ÕâÐèÒªphp¸ù¾ÝÿÌìµÄÈÕÆÚ½øÐмÆËã,ÏÂÃæ¾ÍÀ´Ì¸Ì¸ÊµÏÖÕâÖÖÈÕÆÚ¼ÆËãµÄ¼¸ÖÖ·½·¨:
(1) Èç¹ûÓÐÊý¾Ý¿â¾ÍºÜÈÝÒ×ÁË!ÈôÊÇMSSQL¿ÉÒÔʹÓô¥·¢Æ÷!ÓÃרÃżÆËãÈÕÆÚ²îµÄº¯Êýdatediff()±ã¿É ......