PHPºÍflex½»»¥ÂÒÂë
Õâ¸öÔÒòÓÐÒÔϼ¸¸ö£º
µÚÒ»£¬ÔÚphpÖеÄÄÚÈݲ»ÊÇÓÃutf-8½øÐбàÂëµÄ£¬¿ÉÒÔÔÙphpÍ·²¿Ìí¼Ó£ºheader("Content-Type:text/html;charset=utf-8");
µÚ¶þ£¬phpÎļþ±¾Éí²»ÊÇutf-8±àÂëµÄ£¬Õâ¿ÉÒÔ¸ü¸Äzend-studio£¬µÄÎļþ±àÂë¸ñʽ£¬Ö¸¶¨Îªutf-8·½·¨ÊÇ£ºwindw->preference->General->Workspace->Text file encoding,Ñ¡Ôñutf-8.
Ïà¹ØÎĵµ£º
PHPnow ÊÇʲô?
Win32 ÏÂÂÌÉ«Ãâ·ÑµÄ Apache + PHP + MySQL »·¾³Ì×¼þ°ü¡£
¼òÒ×°²×°¡¢¿ìËٴ֧³ÖÐéÄâÖ÷»úµÄ PHP »·¾³¡£¸½´ø PnCp.cmd ¿ØÖÆÃæ°å£¬°ïÖúÄã¿ìËÙÅäÖÃÄãµÄÌ×¼þ£¬Ê¹Ó÷dz£·½±ã¡£
PHPnow ÊÇÂÌÉ«µÄ£¬½âѹºóÖ´ÐÐ Init.cmd ³õʼ»¯£¬¼´¿ÉµÃµ½Ò»¸ö PHP + MySQL »·¾³¡£
È»ºó¾Í¿ÉÒÔÖ±½Ó°²×° Discuz!, PHPWind, ......
´î½¨ PHP Æäʵ²»ºÜÄÑ£¬Ö»ÊÇÓе㷱Ëö¡£ÒªÊÇ×Ô¼º´î½¨Ò»´Î PHP + MySQL »·¾³ºÜÊÇ·Ñʱ¡£¸üÔãµÄÊÇ£¬ºÜ¶àÐÂÊÖÔÚÅäÖà PHP
ʱ³£³£³öÏÖÕâÑùÄÇÑùµÄÎÊÌâ¡£ÖîÈç mysql À©Õ¹¡¢zend °²×°Ê§°ÜµÈµÈÎÊÌâ¡£Õâʱ£¬ÎÒÃÇÐèÒªÒ»¸ö¿ìËÙ¡¢±ê×¼ÇÒרҵµÄ PHP
Ì×¼þ°ü¡£PHPnow ¾ÍÕâÑùÓ¦Ô˶øÉú£¬ÎªÄã¿ìËٴרҵµÄÐéÄâÖ÷»ú¡£
Óë PHPnow µÄÃû×ÖÒ ......
__FILE__ ·µ»Øµ±Ç° ·¾¶+ÎļþÃû
dirname(__FILE__) ·µ»Øµ±Ç°Îļþ·¾¶µÄ ·¾¶²¿·Ö
dirname(dirname(__FILE__));µÃµ½µÄÊÇÎļþÉÏÒ»²ãĿ¼Ãû£¨²»º¬×îºóÒ»¸ö“/”ºÅ£© ......
function mysql_conn(){
$conn=mysql_pconnect('localhost','root','root');
mysql_select_db('liuyan');
mysql_query('set names utf8');
return $conn;
}
//$sqlΪSQLÓï¾ä£»$pageΪµÚ¼¸Ò³£¬$pagesizeΪһҳÏÔʾ¶àÉÙÌõ
//×îºó½«·µ»ØÒ»¸öarrayµÄÊý¾ÝÀàÐÍ,ÀïÃæ°üº¬$arr['result']£¬$arr['fypage']
function page ......
Ò»¡¢ÒýºÅ¶¨Òå×Ö·û´®
¡¡¡¡ÔÚPHPÖУ¬Í¨³£Ò»¸ö×Ö·û´®±»¶¨ÒåÔÚÒ»¶ÔÒýºÅÖУ¬È磺
'I am a
string in single quotes'
"I am a string in double
quotes"
¡¡¡¡PHPÓï·¨·ÖÎöÆ÷ÊÇÓóɶԵÄÒýºÅÀ´ÅжÏÒ»¸ö×Ö·û´®µÄ¡£Òò´Ë£¬ËùÓÐ×Ö·û´®±ØÐëʹÓÃͬһÖÖµ¥»òÕßË«
ÒýºÅÀ´¶¨Ò忪ʼºÍ½áÊø¡£ÀýÈ磬ÏÂÃæµÄ×Ö´®¶¨ÒåÊDz» ......