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

PHPÖе¥ÒýºÅÓëË«ÒýºÅµÄÇø±ð

 
Ò»¡¢ÒýºÅ¶¨Òå×Ö·û´®
¡¡¡¡ÔÚPHPÖУ¬Í¨³£Ò»¸ö×Ö·û´®±»¶¨ÒåÔÚÒ»¶ÔÒýºÅÖУ¬È磺
'I am a
string in single quotes'
"I am a string in double
quotes"
¡¡¡¡PHPÓï·¨·ÖÎöÆ÷ÊÇÓóɶԵÄÒýºÅÀ´ÅжÏÒ»¸ö×Ö·û´®µÄ¡£Òò´Ë£¬ËùÓÐ×Ö·û´®±ØÐëʹÓÃͬһÖÖµ¥»òÕßË«
ÒýºÅÀ´¶¨Ò忪ʼºÍ½áÊø¡£ÀýÈ磬ÏÂÃæµÄ×Ö´®¶¨ÒåÊDz»ºÏ·¨µÄ£º
"I
am not a valid string since I have unmatching quote marks'
'Me
neither!"
¡¡¡¡¶¨Òå×Ö·û´®Ê±£¬Ö»ÓÐÒ»ÖÖÒýºÅ±»ÊÓΪ¶¨Òå·û£¬¼´µ¥ÒýºÅ»òË«ÒýºÅ¡£ÓÚÊÇ£¬Èç¹ûÒ»¸ö×Ö·û´®ÓÉË«Òý
ºÅ¿ªÊ¼£¬ÄÇôֻÓÐË«ÒýºÅ±»·ÖÎöÆ÷½âÎö¡£ÕâÑù£¬Äã¾Í¿ÉÒÔÔÚË«ÒýºÅ´®Öаüº¬ÈκÎÆäËû×Ö·û£¬ÉõÖÁµ¥Òý
ºÅ¡£ÏÂÃæµÄÒýºÅ´®¶¼ÊǺϷ¨µÄ£º
$s
= "I am a 'single quote string' inside a double quote string";
$s = 'I am a
"double quote string" inside a single quote
string';
¡¡¡¡µ±PHPÓöµ½Óë´®µÄ¿ªÍ·Ïà¶ÔÓ¦µÄÒýºÅʱ£¬±ãÈÏΪÒѾ­µ½ÁË×Ö·û´®Î²²¿£¬ÓÚÊÇ£º
"Why doesn't "this"
work?"
¡¡¡¡Êµ¼ÊÉϱ»PHPÓï·¨·ÖÎöÆ÷·Ö³ÉÈý¸ö²¿·Ö:
"Why doesn't
"——°üº¬Ò»¸öµ¥ÒýºÅµÄË«ÒýºÅ´®
this——¶àÓàµÄ×Ö·û£¬·ÖÎöÆ÷ÎÞ·¨´¦Àí
" work?"
——ÆÕͨ×Ö·û´®
¡¡¡¡ÉÏÃæµÄÕâ¸öÀý×ÓÆóͼÔÚË«ÒýºÅ´®Öаüº¬Ë«ÒýºÅ£¬¶ø·ÖÎöÆ÷ÔÚÓöµ½µÚ¶þ¸öË«ÒýºÅʱ±ãÈÏΪ×Ö·û´®½á
ÊøÁË¡£Òª´ïµ½°üº¬ÒýºÅµÄÄ¿µÄ£¬±ØÐë·ÖÎöÆ÷ÔÚÓöµ½´®ÄÚÆÕͨÒýºÅµÄʱºòºöÂÔËüµÄÔ­Ò⣬ÎÒÃÇÔÚÒýºÅµÄ
Ç°Ãæ¼ÓÉÏÒ»¸ö·´Ð±¸ÜÀ´¸æËßPHP£ºÕâ¸öÒýºÅÊÇ×Ö·û´®µÄÒ»²¿·Ö£¬ÕýÈ·µÄ±íʾ·½·¨ÊÇÕâÑù:
"Why
doesn't \"that\"
work?"
¡¡¡¡ÔÚÓ¢ÎÄ×Ö·û´®ÖÐÒ»¸ö³£¼ûµÄÎÊÌâÊÇƲºÅ'µÄʹÓã¬ÒòΪËü¾ÍÊÇÒ»¸öµ¥ÒýºÅ£¬¶øÔÚÓ¢ÎÄ´®ÖÐÊ®·Ö³£¼û
£¨Ó¢ÎÄËùÓиñ£©¡£Äã±ØÐëСÐÄ´¦ÀíÕâЩ×Ö·û:
'You\'d
better escape your
apostrophes'
¡¡¡¡¿ÉÒÔ¿´µ½·´Ð±¸ÜÔÚ×Ö·û´®ÖÐÓÐËûµÄÌØÊ⺬Ò壬µ±ÎÒÃÇÐèÒªÔÚ×Ö·û´®Öаüº¬·´Ð±¸Ü±¾Éíʱ£¬ÐèÒªÔÚ
¸Ã·ûºÅÇ°Ãæ¶à¼ÓÒ»¸ö·´Ð±¸Ü¡£ÀýÈ磺
$file
= "c:\windows\system.ini";
echo $file; // ´òÓ¡½á¹ûΪ£º c:windowssystem.ini
$file
= "c:\\windows\\system.ini";
echo $file; // ´òÓ¡½á¹ûΪ£º
c:\windows\system.ini
¡¡¡¡ÁíÒ»ÖÖ×Ö·û´®¶¨Ò巽ʽ£¬Äܹ»Ïû³ýÌØÊâ×Ö·ûµÄ·³ÄÕ£¬¶øÇÒ±ãÓÚÒýÓýϳ¤µÄÎı¾¡£¸Ã×Ö·û´®¶¨Òå·½
·¨ÒÔ<


Ïà¹ØÎĵµ£º

PHPµãµãµÎµÎ

1¡¢²¼¶ûÖµ£ºfalse(0,¿Õ°×,null);    true(-1,·Ç0Öµ)£» 2¡¢echo '$s'Êä³öÄÚÈÝÊÇ $s;  
    Èç¹û""ÀïÃæ°üº¬ÁË$s»òÕß{$s}£¬ÄÇô½«ÏÔʾµÄ±äÁ¿µÄÖµ¡£ÍƼöʹÓÃ{$s}µÄ·½Ê½¡£
    ʹÓÃ""ʱºò£¬Èç¹ûÔÚ""ÀïÃ滹ҪʹÓÃ"",¾Í±ØÐëÓÃ\À´×ªÒå,ÀýÈ磺 echo "\"sss\""; 3¡¢ ......

PHP×Ô¶¯×ª»»×ªÒå×Ö·û

ÔÚphp.iniÎļþÖÐmagic_quotes_gpc = on   ---- Ò»°ãÇé¿öÏÂÊÇon£¬ÅÂÓû§Íü¼ÇתÒåijЩÌØÊâ×Ö·û¡£
Òò´Ë£¬ÒªÅжϵ±Ç°phpµÄÅäÖÃҪȡµÃÎÒÃÇÏëÒªµÄÄÚÈÝ¡£
$gpc=get_magic_quotes_gpc();     ----·µ»Ø1,magic_quotes_gpc = on£¬0Ϊoff
if ($gpc==1){
     $json=s ......

PHPnow = Apache + PHP + MySQL + phpMyAdmin

 
PHPnow ÊÇʲô?
Win32 ÏÂÂÌÉ«Ãâ·ÑµÄ Apache + PHP + MySQL »·¾³Ì×¼þ°ü¡£
¼òÒ×°²×°¡¢¿ìËٴ֧³ÖÐéÄâÖ÷»úµÄ PHP »·¾³¡£¸½´ø PnCp.cmd ¿ØÖÆÃæ°å£¬°ïÖúÄã¿ìËÙÅäÖÃÄãµÄÌ×¼þ£¬Ê¹Ó÷dz£·½±ã¡£
PHPnow ÊÇÂÌÉ«µÄ£¬½âѹºóÖ´ÐÐ Init.cmd ³õʼ»¯£¬¼´¿ÉµÃµ½Ò»¸ö PHP + MySQL »·¾³¡£
È»ºó¾Í¿ÉÒÔÖ±½Ó°²×° Discuz!, PHPWind, ......

ʹÓà PHPnow ´î½¨ PHP »·¾³[ͼ]

 ´î½¨ PHP Æäʵ²»ºÜÄÑ£¬Ö»ÊÇÓе㷱Ëö¡£ÒªÊÇ×Ô¼º´î½¨Ò»´Î PHP + MySQL »·¾³ºÜÊÇ·Ñʱ¡£¸üÔãµÄÊÇ£¬ºÜ¶àÐÂÊÖÔÚÅäÖà PHP
ʱ³£³£³öÏÖÕâÑùÄÇÑùµÄÎÊÌâ¡£ÖîÈç mysql À©Õ¹¡¢zend °²×°Ê§°ÜµÈµÈÎÊÌâ¡£Õâʱ£¬ÎÒÃÇÐèÒªÒ»¸ö¿ìËÙ¡¢±ê×¼ÇÒרҵµÄ PHP
Ì×¼þ°ü¡£PHPnow ¾ÍÕâÑùÓ¦Ô˶øÉú£¬ÎªÄã¿ìËٴרҵµÄÐéÄâÖ÷»ú¡£
Óë PHPnow µÄÃû×ÖÒ ......

PHP µ÷ÊÔÖ¸ÄÏ


Ò»¡¢Ç°Ìá
       ÎÒÃÇÐèÒªÒ»¸ö Web ·þÎñÆ÷À´½âÎöÓà PHP ´´½¨µÄÒ³Ãæ²¢°ÑËüÃÇÏÔʾµ½ä¯ÀÀÆ÷¡£±¾ÎÄÖÐʹÓõÄÊÇ Apache2¡£µ«ÊÇ£¬ÈκΠWeb ·þÎñÆ÷¶¼¿ÉÒÔÂú×ãÒªÇó¡£
       ÒªÀûÓñ¾ÎÄÖнéÉܵÄһЩµ÷ÊÔ¼¼Êõ£¬ÐèÒª°²×° Eclipse V3.1.1 ºÍ²å¼þ PHPEclipse V ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ