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

PHPÖеÄstdClass

  
Èç¹ûËùÓеÄClass¶¼Ó¦¸Ã´æÔÚÓÚÒ»¸öĬÈϵIJ㼶ÖеĻ°£¬ÄÇô×²ãÓ¦¸ÃÊÇ×îΪһ°ãµÄClass£¬Ò²¾ÍÊÇ˵¼«Îª³éÏóµÄ£¬Ã¿Ò»¸öϲãµÄClass¾ù±ÈÆäÉϲã
µÄClass£¨¼´¸¸Àࣩ¸ü¼ÓרÃÅ»¯¡£»ùÓÚ¸Ã˼Ï룬ÔÚPHPÖУ¬Õâ¸ö¶¥²ãµÄClass±»ÃüÃûΪ“stdClass”£¬ÇÒ×÷Ϊһ¸ö“Standard
Class”£¬Äã¿ÉÒÔ°ÑËü¿´³ÉÊÇÒ»¸ö²»º¬ÈκÎÊôÐԺͷ½·¨µÄÀà¡£
ʹÓÃstdClassµÄÄ¿µÄ£º ÔÚÔËÐÐʱÌí¼ÓÊôÐÔµ½»ù¶ÔÏó£¨Base Object£©
ÎÊÌâ
ÄãÏë´´½¨Ò»¸ö¶ÔÏ󣬲¢ÔÚÆäÖÐÌí¼ÓһЩÊôÐÔ£¬µ«ÊÇÄãÈ´²»Ïë°ÑËü×÷Ϊһ¸öÃ÷È·µÄÀàÕýʽµØ¶¨ÒåËü¡£ÕâÒ»µãÔÚһЩÇé¿öÏÂÊÇÏ൱ÓÐÓõģ¬ÀýÈçµ±ÄãÐèÒª¶¨ÒåÒ»¸ö·½·¨À´
·µ»Ø´øÓÐijЩÊôÐÔ£¨²»È·¶¨µÄ£©µÄ¶ÔÏóʱ£¬¾ÍÈçͬ´Ómysql_fetch_object( ) »òÕß imap_header( )µÄʹÓÃÒ»Ñù¡£
½â¾ö·½°¸
ʹÓÃPHPÄÚ½¨À࣬stdClass:
$pickle
=
new
stdClass;   
$pickle
->type =
'fullsour'
;  
ÌÖÂÛ
´´½¨Ò»¸östdClassÀàÐ͵ĶÔÏó£¬Æä²»º¬ÓÐÈκÎÊôÐԺͷ½·¨£¬¾ÍÏñarray( )·µ»ØÒ»¸ö¿ÕÊý×éÒ»Ñù¡£
Äã¿ÉÒÔΪÆä´´½¨Ò»¸öеÄÊôÐÔ²¢·ÖÅä¸øËüij¸öÖµ£¬È»ºó¼ì²éËüµÄÖµ¡£
$guss
=
new
stdClass;   
$guss
->location =
'Essex'
;   
print
"$guss->location\n"
;   
$guss
->location =
'Orchard'
;   
print
"$guss->location\n"
;  
·½·¨£¬ÎÞÂÛÈçºÎÔÚÒ»¸ö¶ÔÏó±»³õʼ»¯Ö®ºóÔÙÈ¥¶¨ÒåËü¡£µ«ÊÇÔÚÄãÏëʹÓÃÒ»¸öÏñ´ÓÊý¾Ý¿â½á¹û¼¯ÖÐÌáÈ¡³öÀ´µÄ¶ÔÏó£¨mysql_fetch_object·½·¨£¬±Ï¾¹ÔÚµ÷ÓÃËüÊÇÄã²¢²»ÏñÕæÕýµØÈ¥ÇëÇóÊý¾Ý¿â£©ÕâÑùµÄÒ»°ã¶ÔÏóʱ£¬´´½¨ stdClass ¶ÔÏóÊǷdz£ÓÐÓõġ£ÈçÏ£º
function
pc_format_address(
$obj
) {   
   
return

"$obj->name <$obj->email>"
;   
}   
  
$sql
=
"SELECT name, email from users WHERE id=$id"
;   
$dbh
= mysql_query(
$sql
);   
$obj
= mysql_fetch_object(
$dbh
);   
print pc_format_address(
$obj
);  
pc_format_address·½·¨Ê¹ÓÃÒ»¸ö¶ÔÏóµÄname ºÍ email ÊôÐÔ£¬È»ºóʹÆä¸ñʽ»¯ºó·µ»Ø(ÈçÉÏ´úÂë)¡£ÏÂÃæÎÒÃDz»µ÷ÓÃmysql_fetch_object·½·¨£¬Ó¦¸ÃÈçºÎʹÓÃÄØ£¿
$obj
=
new
stdClass;  


Ïà¹ØÎĵµ£º

linux+ngnix+php °²×°ÅäÖÃ

 Èí¼þÏÂÔصØÖ·£º
pcre£ºhttp://www.pcre.org/ 
Nginx£ºhttp://nginx.net/
spawn-fcig: http://redmine.lighttpd.net/projects/spawn-fcgi/news
ÀûÓà wget ÃüÁîÏÂÔØÏàÓ¦µÄ °²×°°ü
²½Öè
1¡¢°²×°pcre
     ngnix ÐèÒª°²×°pcre¿â£º
    wget http://sourceforge.net ......

PHPÊÓƵ½Ì³ÌÏÂÔØ£¨PHP100ϵÁÐÊÓƵ½Ì³Ì£©

PHPÊÓƵ½Ì³ÌÏÂÔØ£¨PHP100ϵÁÐÊÓƵ½Ì³Ì£©
PHP100ÊÇÒ»¸öÕë¶ÔPHP³õѧÕßµÄPHPÊÓƵ½ÌѧÍøÕ¾£¬ÓÐÂù¸ßµÄÈËÆøºÍ»îÁ¦¡£Ä¿Ç°ÍøÉϵÄPHPµÄÊÓƵ×ÊÔ´²¢²»¶à£¬¶àÊý¶¼ÊÇÔÚÓÅ¿áµÈÊÓƵÍøÕ¾ÉϵĽ̳̣¬ÊÓƵ²»ÇåÎú£¬¶øÇÒÒ²²»È«ÃæºÍϵͳ¡£¶øPHP100ÍøÕ¾ÉϵÄϵÁÐÊÓƵ½Ì³Ì£¬ÅäÓпμþ£¬´ÓÈëÃŵ½¾«Í¨£¬ºÜ²»´í£¬»ù±¾±£³ÖÒ»ÖÜÒ»ÆڵĸüÐÂËٶȡ£share it£ ......

»ùÓÚPHPµÄÍøÉÏÉ̳ǹÜÀíÐÅϢϵͳ·ÖÎöÓëÉè¼Æ ¿ªÌⱨ¸æ

»ùÓÚPHPµÄÍøÉÏÉ̳ǹÜÀíÐÅϢϵͳ·ÖÎöÓëÉè¼Æ
 
Ò»¡¢   (±³¾°½éÉÜ)Ñ¡ÌâÒÀ¾Ý¼°¼ÛÖµ£º
2008ÄêÏ°ëÄê,È«ÇòÐԵĽðÈÚΣ»ú±¬·¢,ÂûÑÓÖÁ¸÷¸ö²úÒµ¼°ÁìÓò,Õâ´Î¾­¼ÃµÄ´óÏôÌõÈÃÎÒ¿´µ½µÄÊÇ»úÓö,ÖйúÔÚÕâ´Î¾­¼ÃΣ»úÖÐÏÔʾÁ˲»·²µÄʵÁ¦Ó뷢չDZÁ¦,µ±ÆóÒµÃæÁÙÀ§¾³µÄʱºò,×îÏÈÏëµ½µÄÊÇÈçºÎËõ¼õÉÌÒµ³É±¾,±ÈÈç²ÃÔ±½µÐ½,Ëæ×ÅÍøÂç ......

PHPÁ¬½ÓMySQL

<?php
/**
* Mysql DB
*
* @author Administrator
* @package defaultPackage
*/
class MySqlDB{
private $_db;
private static $_instance;
private function __construct(&$db_type){
global $connectionstr;
$conn_db=$connectionstr[$db_type];
$this->_db=mysql_pconnect($conn ......

PHPÖÐʹÓÃstrip_tags() È¥³ýhtml±êÇ©

 
ƽʱÓà htmlspecialchars() À´¹ýÂËhtml, µ«ÊÇ°ÑhtmlµÄ×Ö·ûתÒåÁË,×îºóÏÔʾ³öÀ´µÄ¾ÍÊÇhtmlÔ´´úÂë, ÀûÓÃstrip_tags()¾Í¿ÉÒÔ°Ñhtml±êÇ©È¥³ýµô.
[php]
$str = 'harryxu
‘;
echo(htmlspecialchars($str) . ‘
‘);
echo(strip_tags($str));
// output:
// harryxu
// harryxu
?> 
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ