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

php ×Ö·û´®²Ù×÷º¯ÊýÏê½â

×Ö·û´®µÄ²Ù×÷ÔÚPHP±à³ÌÖÐÕ¼ÓÐÖØÒªµÄµØ룬¼¸ºõËùÓÐPHP½Å±¾µÄÊäÈëºÍÊä³ö¶¼Óõ½×Ö·û´®¡£ÓÈÆäÔÚPHPÏîÄ¿¿ª·¢¹ý³ÌÖУ¬ÎªÁËʵÏÖijÏÄÜ£¬¾©³ÇÐèÒª¶ÔijЩ×Ö·û´®½øÐÐÌØÊâ´¦Àí£¬Èç»ñÈ¡×Ö·û´®µÄ³¤¶È¡¢½ØÈ¡×Ö·û´®¡¢Ìæ»»×Ö·û´®µÈ¡£ËùÒÔÕâÒ²ÊÇÎÒÃǽñÌì¿Î³ÌµÄÖ÷ÒªÄÚÈÝ£¬Ï£ÍûѧԱ¿ÉÒÔÈÏÕæѧϰ£¬ÇÚ¼ÓÁ·Ï°¡£
8.3.1 È¥³ý×Ö·û´®Ê×λ¿Õ¸ñºÍÌØÊâ×Ö·û
1.  trim()º¯Êý£º trim()º¯ÊýÓÃÓÚÈ¥³ý×Ö·û´®×óÓÒÁ½±ßµÄ¿Õ¸ñ¼°\n,\r,\tµÈ£¬Óï·¨£º
String trim(string str[,string charlist]);
    2£® ltrim()º¯Êý£º´Ëº¯ÊýÓÃÓÚÈ¥³ý×Ö·û´®×ó±ßµÄ¿Õ¸ñ»òÕßÖ¸¶¨×Ö·û´®£¬Ó÷¨Óëtrim()Ò»Ñù£¬ÕâÀï²»ÔÙ¶à×ö½éÉÜ¡£Ïà¶ÔÓ¦µÄ£¬»¹ÓÐÒ»¸örtrim()º¯Êý£¬ÓÃÀ´È¥³ý×Ö·û´®ÓұߵĿոñ»òÖ¸¶¨×Ö·û´®¡£
8.3.2 תÒå¡¢»¹Ô­×Ö·û´®Êý¾Ý
1. ÊÖ¶¯×ªÒå¡¢»¹Ô­×Ö·û´®Êý¾Ý
תÒå·û£º\
ʹÓ÷½·¨£º½«´ËתÒå·û·ÅÔÚÒªÏÔʾµÄÌØÊâ·ûºÅ֮ǰ¼´¿É£¬ÈçÒªÔÚ×Ö·û´®ÖÐÏÔʾ’£¬¾ÍÐèÒªÓÃתÒå·û\’£¬ÕâÑù£¬½ô¸úÔÚ\ºóÃæµÄµÚÒ»¸ö×Ö·û¾Í±äµÃûÓÐÒâÒå»îÓÐÌØÊâÒâÒ壬ÈçÏÂʵÀý£º
<?php
    echo ‘select * from tb_book where bookname = \’PHP³õ¼¶½Ì²Ä\’’;
?>
Êä³ö½á¹ûΪ£ºselect * from tb_book where bookname = ‘PHP³õ¼¶½Ì²Ä’
1. ×Ô¶¯×ªÒå¡¢»¹Ô­×Ö·û´®Êý¾Ý
    ×Ô¶¯×ªÒå¡¢»¹Ô­×Ö·û´®Êý¾Ý¿ÉÒÔÓ¦ÓÃPHPÌṩµÄaddslashes()º¯ÊýºÍstripslashes()º¯Êý£¬ÏÂÃæ·Ö±ð½éÉÜÕâÁ½¸öº¯Êý£º
    addslashes()º¯Êý£º´Ëº¯ÊýÓÃÀ´Îª×Ö·û´®str¼ÓÈëбÏß“\”¡£Óï·¨£º
String addslashes(string str)
stripslashes()º¯Êý£º´Ëº¯ÊýÓÃÀ´½«Ê¹ÓÃaddslashes()º¯ÊýתÒåºóµÄ×Ö·û´®str·µ»ØÔ­Ñù¡£Óï·¨£º
String stripslashes(string str)
    addcslashes()º¯Êý£ºÊµÏÖתÒå×Ö·û´®ÖеÄ×Ö·û£¬¼´ÔÚÖ¸¶¨µÄ×Ö·ûcharlistÇ°¼ÓÉÏ·´Ð±Ïߣ»stripcslashes()º¯ÊýÔòÓÃÀ´½«Ó¦ÓÃaddcslashes()º¯ÊýתÒåµÄ×Ö·û´®str»¹Ô­¡£Óï·¨ºÍaddslashes()¼°stripslashes()ÊÇÒ»ÑùµÄ¡£
8.3.3 »ñÈ¡×Ö·û´®³¤¶È
         »ñÈ¡×Ö·û´®µÄ³¤¶ÈÖ÷Ҫͨ¹ýstrlen()º¯ÊýʵÏÖ£¬ÏÂÃæÖص㽲½âstrlen()º¯ÊýµÄÓï·¨¼°ÆäÓ¦Óá£
Óï·¨£º
int strlen(string str)
ʵÀý£º
<?php
    echo strlen(“ÐÀ²Å½ÌÓý£ºwww.phpedu.org”)£»  //½á¹û£º24
?>
˵Ã÷£ºÊý×ÖÕ¼Á½¸ö×Ö·û£¬Êý×Ö¡


Ïà¹ØÎĵµ£º

PHP CURLÏê½â

ÉùÃ÷£º²¹³ä·­ÒëÁËÔ­ÌûÖм¸´¦Î´·­Òë´¦¡£
---------------------------------------------------- תÌû¿ªÊ¼ -------------------------------------------------------
PHPÖеÄCURLº¯Êý¿â£¨Client URL Library Function£© 
curl_close - ¹Ø±ÕÒ»¸öcurl»á»° 
curl_copy_handle - ¿½±´Ò»¸öcurlÁ¬½Ó×ÊÔ´µÄËùÓÐÄÚÈݺ ......

PHPÖлùÓÚMVCģʽµÄСÐÍÏîÄ¿×ܽá

×î½ü×öÁ˼¸¸öСÐ͵ÄÏîÄ¿£¬±È½Ï¼òµ¥£¬Ö»ÊÇÐèҪϸÐÄ£¬¶¼¿ÉÒÔÍê³É£¬Ö÷ÒªÊǶÔMVCģʽµÄÊìÁ·Ó¦Ó㬶ÔWEBÀ࿪·¢»¹ÊǺÜÓаïÖúµÄ¡£
¸Õ¿ªÊ¼µÄµÚÒ»¸öСÏîÄ¿£¬ÓÃÀ´Á·ÊÖ£¬È»ºóÎÒÈ«²¿ÊÇÁ÷³Ì»¯µÄ±à³Ì¡£´úÂëÒ²¾Í400ÐÐ×óÓÒ¡£½á¹ûÎҵĵ¼Ê¦£¬¾õµÃ´úÂë½á¹¹²»ÇåÎú£¬²»ÈÝÒ×
ά»¤£¬ÐèÒªÐ޸ġ£ÐèÒªÎÒ²ÉÓÃOOÀàµÄ±à³Ì·½Ê½½øÐиÄд¡£ÎÒÒÔǰдPHP£¬¼¸ ......

PHP·ÖÒ³ÏÔʾÖÆ×÷Ïêϸ½²½â


1¡¢Ç°ÑÔ
·ÖÒ³ÏÔʾÊÇÒ»Öַdz£³£¼ûµÄä¯ÀÀºÍÏÔʾ´óÁ¿Êý¾ÝµÄ·½·¨£¬ÊôÓÚweb±à³ÌÖÐ×î³£´¦ÀíµÄʼþÖ®Ò»¡£¶ÔÓÚweb±à³ÌµÄÀÏÊÖÀ´Ëµ£¬±àдÕâÖÖ´úÂëʵÔÚÊǺͺôÎüÒ»Ñù×ÔÈ»£¬µ«ÊǶÔÓÚ³õѧÕßÀ´Ëµ£¬³£³£¶ÔÕâ¸öÎÊÌâÃþ²»×ÅÍ·Ð÷£¬Òò´ËÌصØ׫д´ËÎĶÔÕâ¸öÎÊÌâ½øÐÐÏêϸµÄ½²½â£¬Á¦ÇóÈÿ´ÍêÕâƪÎÄÕµÄÅóÓÑÔÚ¿´ÍêÒÔºó¶ÔÓÚ·ÖÒ³ÏÔʾµÄÔ­ÀíºÍʵÏÖ·½· ......

PHPÖеij£ÓõÄ25¸öMYSQLº¯Êý


1¡¢mysql_connect()-½¨Á¢Êý¾Ý¿âÁ¬½Ó
¸ñʽ£º
resource mysql_connect([string hostname [:port] [:/path/to/socket] [, string username] [, string password]])
Àý£º
$conn = @mysql_connect(”localhost”, “username”, “password”) or dir(”²»ÄÜÁ¬½Óµ½Mysql Server” ......

PHP ¶àÓïÑÔÍøÕ¾½â¾ö·½°¸

Ç°ÑÔ£º
¡¡¡¡¶àÓïÑÔÍøÕ¾¿ª·¢£¬ÖصãµÄ»¹ÊÇÔÚ½â¾öÓïÑÔÖ®¼äµÄÎÊÌâ¡£
¡¡¡¡ÄÇÈçºÎ½â¾öÕâ¸öÎÊÌâÄØ?´ó¸Å¾Í·ÖÈý²½×ߣº
¡¡¡¡1.Ò³Ãæ¶àÓïÑÔ
¡¡¡¡2.Êý¾Ý¿â¶àÓïÑÔ
¡¡¡¡3.Óû§·ÃÎÊÓïÑÔͳһ
¡¡¡¡1.Ò³Ãæ¶àÓïÑÔ
¡¡¡¡ÐèÒª¿¼ÂǵÄÎÊÌ⣺
¡¡¡¡A.Óû§µÇ½ʱºò£¬×Ô¶¯Ê¶±ð×Ö·û£¬µ÷Óò»Í¬µÄÓïÑÔ°ü?
¡¡¡¡B.Óû§Çл»²»Í¬ÓïÑÔʱºò£¬µ÷Óò»Í¬µÄÓï ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ