Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

[ת]PHPÖÐÎÄÂÒÂëµÄ³£¼û½â¾ö·½·¨×ܽá

¡¡PHPÖÐÎÄÂÒÂëÊÇPHP¿ª·¢Öеij£¼ûÎÊÌâÖ®Ò»¡£PHPÖÐÎÄÂÒÂëÓÐʱ·¢ÉúÔÚÍøÒ³±¾Éí£¬ÓÐЩ²úÉúÔÚÓÚMySQL½»»¥µÄ¹ý³ÌÖУ¬ÓÐʱÓë²Ù×÷ϵͳÓйء£ÏÂ
Ãæ½øÐÐÒ»·¬×ܽᡣ
¡¡¡¡Ò».Ê×ÏÈÊÇPHPÍøÒ³µÄ±àÂë
¡¡¡¡1. phpÎļþ±¾ÉíµÄ±àÂëÓëÍøÒ³µÄ±àÂëӦƥÅä
¡¡¡¡a. Èç¹ûÓûʹÓÃgb2312±àÂ룬ÄÇôphpÒªÊä³öÍ·£ºheader(“Content-Type: text/html;
charset=gb2312")£¬¾²Ì¬Ò³ÃæÌí¼Ó£¬ËùÓÐÎļþµÄ±àÂë¸ñʽΪANSI£¬¿ÉÓüÇʱ¾´ò¿ª£¬Áí´æΪѡÔñ±àÂëΪANSI£¬¸²¸ÇÔ´Îļþ¡£
¡¡¡¡b. Èç¹ûÓûʹÓÃutf-8±àÂ룬ÄÇôphpÒªÊä³öÍ· £ºheader(“Content-Type: text/html;
charset=utf-8")£¬¾²Ì¬Ò³ÃæÌí¼Ó£¬ËùÓÐÎļþµÄ±àÂë¸ñʽΪutf-8¡£±£´æΪutf-8¿ÉÄÜ»áÓеãÂé·³£¬Ò»°ãutf-8Îļþ¿ªÍ·»áÓÐBOM£¬
Èç¹ûʹÓÃ
session¾Í»á³öÎÊÌ⣬¿ÉÓÃeditplusÀ´±£´æ£¬ÔÚeditplusÖУ¬¹¤¾ß->²ÎÊýÑ¡Ôñ->Îļþ->UTF-8Ç©Ãû£¬Ñ¡Ôñ×Ü
ÊÇɾ³ý£¬ÔÙ±£´æ¾Í¿ÉÒÔÈ¥µôBOMÐÅÏ¢ÁË¡£
¡¡¡¡2.
php±¾Éí²»ÊÇUnicodeµÄ£¬ËùÓÐsubstrÖ®ÀàµÄº¯ÊýµÃ¸Ä³Émb_substr(ÐèҪװmbstringÀ©Õ¹);»òÕßÓÃiconvתÂë¡£
¡¡¡¡¶þ.PHPÓëMysqlµÄÊý¾Ý½»»¥
¡¡¡¡PHPÓëÊý¾Ý¿âµÄ±àÂëÓ¦Ò»ÖÂ
¡¡¡¡1. ÐÞ¸ÄmysqlÅäÖÃÎļþmy.ini»òmy.cnf£¬mysql×îºÃÓÃutf8±àÂë
¡¡¡¡[mysql]
¡¡¡¡default-character-set=utf8
¡¡¡¡[mysqld]
¡¡¡¡default-character-set=utf8
¡¡¡¡default-storage-engine=MyISAM
¡¡¡¡ÔÚ[mysqld]ϼÓÈë:
¡¡¡¡default-collation=utf8_bin
¡¡¡¡init_connect='SET NAMES utf8'
¡¡¡¡2. ÔÚÐèÒª×öÊý¾Ý¿â²Ù×÷µÄphp³ÌÐòÇ°¼Ómysql_query("set names
'±àÂë'");£¬±àÂëºÍphp±àÂëÒ»Ö£¬Èç¹ûphp±àÂëÊÇgb2312ÄÇmysql±àÂë¾ÍÊÇgb2312£¬Èç¹ûÊÇutf-8ÄÇmysql±àÂë¾ÍÊÇ
utf8£¬ÕâÑù²åÈë»ò¼ìË÷Êý¾Ýʱ¾Í²»»á³öÏÖÂÒÂëÁË
¡¡¡¡Èý.PHPÓë²Ù×÷ϵͳÏà¹Ø
¡¡¡¡WindowsºÍLinuxµÄ±àÂëÊDz»Ò»ÑùµÄ£¬ÔÚWindows»·¾³Ï£¬µ÷ÓÃPHPµÄº¯Êýʱ²ÎÊýÈç¹ûÊÇutf-8±àÂë»á³öÏÖ´íÎ󣬱ÈÈç
move_uploaded_file()¡¢filesize()¡¢readfile()µÈ£¬ÕâЩº¯ÊýÔÚ´¦ÀíÉÏ´«¡¢ÏÂÔØʱ¾­³£»áÓõ½£¬µ÷ÓÃʱ¿ÉÄÜ»á³öÏÖÏÂ
ÃæµÄ´íÎó:
¡¡¡¡Warning: move_uploaded_file()[function.move-uploaded-file]:failed
to open stream: Invalid argument in ...
¡¡¡¡Warning: move_uploaded_file()[function.move-uploaded-file]:Unable
to move '' to '' in ...
¡¡¡¡Warning: filesize() [function.filesize]: stat failed for ... in ...
¡¡¡¡Warning: readfile() [function.r


Ïà¹ØÎĵµ£º

php¿ª·¢50¸ö·Ç³£ÓÐÓõŤ¾ß¡¾×ª¡¿

ÕâÀï50¸öÓÐÒæµÄPHP¹¤¾ß£¬¿ÉÒÔ´ó´óÌá¸ßÄãµÄ±à³Ì¹¤×÷£º
µ÷ÊÔ¹¤¾ß
Webgrind
Xdebug
Gubed PHP Debugger
DBG
PHP_Debug
PHP_Dyn
MacGDBp
²âÊÔºÍÓÅ»¯¹¤¾ß
PHPUnit
SimpleTest
Selenium
PHP_CodeSniffer
dBug
PHP Profile Class
Îĵµ¹¤¾ß
phpDocumentor
PHP DOX
°²È«¹¤¾ß
Securimage
£ºÑéÖ¤Â빤¾ß¡£
Scave ......

PHP ÖÆ×÷ͨѶ¼£¨¶þ£©

ÉÏһƪÖУ¬¼òµ¥Ð´Á˸öInput.php £¬ µ«ÉúÈÕÄÇÒ»À¸Òª×Ô¼ºÊÖ¶¯ÊäÈëд£¬±È½ÏÂé·³£¬ËùÒÔÕâÀïÓõ½Ò»¸öJSÎļþ£¬¿ÉÒÔÑ¡ÔñÈÕÆÚ
µã»÷ÏÂÔØÕâ¸öjsÎļþ
ÔÚInput.phpÎļþ×¶ËÒýÓÃÕâ¸öJSÎļþ
<script type="text/javascript" src="calenderJS.js"></script>
½«ÉúÈÕµÄÊäÈë¿ò¸Ä³É
<input name="birthday" type="text" ......

PHP»º´æ¼¼ÊõÏê½â

PHP»º´æ¼¼ÊõÏê½â
Ò»¡¢»º´æ¼¼Êõ:   
ÓÐЩÐÅÏ¢±È·½¾­³£²»±äµÄ,µ«ÊÇ»¹ÊÇÄܱäµÄÐÅÏ¢·ÅÔÚ»º´æÖÐÒÔ¼Ó¿ìÏÔʾËÙ¶È,ÕâÊǺÜÓмÛÖµµÄ,ËùνµÄ»º´æ,ͨË×µÄÀí½â¾ÍÊÇһЩ±£´æÔÚ·þÎñÆ÷¶ËµÄ¹²ÓÃЊϢ.ËüÊÇÓÚ·þÎñÆ÷ͬÉúËÀµÄ,ÎÒÃÇÔÚ±£´æ»º´æµÄʱºò¿ÉÒÔÖ¸¶¨Ï´θüеÄʱ¼äµÄÅжÏ,±È·½ÒªÔÚ5·ÖÖÓ¸üÐÂÒ»´Î,¿ÉÒԼǼÉϴθüеÄʱ¼ ......

PHP»·¾³ÅäÖÃÐĵÃ


PHP»·¾³ÅäÖÃÐĵÃ
ApacheµÄÅäÖÃ
Ê×ÏÈÎÒÔÚhttp://httpd.apache.org/download.cgiϵÄÊÇ“Win32 Binary without crypto (no mod_ssl) (MSI Installer): httpd-2.2.15-win32-x86-no_ssl.msi”¡£°²×°ÄÇÊÇС¶ù¿ÆÀ²£¬ÏÂÒ»²½ÏÂÒ»²½¡£ÎҾͲ»ËµÁË¡£
°²×°Íêºó¾ÍÒª¿ªÊ¼ÅäÖÃÁË£¬ ......

PHP bug??global·¢ÏÖµÄÎÊÌâ

ÈçÏÂphp´úÂë
<?php
$type='a';
$target='type';
$a=array(1,2,3);
a($target);
function a($type)
{
    global $$type;
    var_dump($$type);
}
?>
Ô¤¼ÆÊä³öµÄÊÇstring(1)”a”
¿ÉÊǽá¹ûÊÇ
Notice: Undefined variable: a in D:\web\global.php on ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ