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;
Ïà¹ØÎĵµ£º
·â×°Ò»¸öfunction£¬ÒԱ㸴Óá£
Ö§³Öhttps£¬»òÕßhttpµÄget»òÕßpost¡£
function httpURLfeedback($url,$request_type,$time_out = "60") {
$arr = parse_url($url);
$transports = "";
$port = 0;
$host = $arr['host'];
$query = $arr['query'];
$path = $arr['path'];
if($urlarr["scheme"] ......
Õâ¸öÔÒòÓÐÒÔϼ¸¸ö£º
µÚÒ»£¬ÔÚ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 ......
ÕâÀï½éÉÜÒ»¸ö¼¯³É»·¾³ XAMPP¡£
XAMPP ÊÇÒ»¸öÒ×ÓÚ°²×°ÇÒ°üº¬ MySQL¡¢PHP ºÍ Perl µÄ Apache ·¢Ðа档XAMPP µÄÈ··Ç³£ÈÝÒ×°²×°ºÍʹÓãºÖ»ÐèÏÂÔØ£¬½âѹËõ£¬Æô¶¯¼´¿É¡£
ÏÂÔصØÖ·£º
http://www.apachefriends.org/zh_cn/xampp.html
µ½Ä¿Ç°ÎªÖ¹£¬XAMPP ¹²ÓÐÒÔÏÂËÄÖÖ°æ±¾£º
£¨1£©ÊÊÓÃÓÚ Linux µÄ XAMPP
£¨2£©ÊÊÓÃÓÚ Windows µ ......
ΪÁËÓ¦¸¶Êý×ÖýÌåʵ¼ùСѧÆÚ£¬ÓÃÁ½ÈýÌìµÄʱ¼ä´Ò´ÒææµØ¼ÜÆðÀ´Ò»¸öPHPÍøÕ¾¡£ÍøÕ¾ºÜ´é£¬ÀÏʦ¸øµÄ·ÖÊýÈÃËü¿´ÆðÀ´¸ü´é¡£
×öÕâ¸öÍøÕ¾µÄÄǶÎʱ¼äÕýºÃÔÚ¿´BrooksµÄÄDZ¾¿õÊÀ¾µä¡¶ÈËÔÂÉñ»°¡·£¬Á˽âÁËÆäÖеēThe Surgical
Team”µÄ¿ª·¢Ä£Ê½£¬¾õµÃÔÚÌØÊⳡºÏÏ£¬ÕâÖÖ¿ª·¢Ä£Ê½È·Êµ»áÓµÓм«¸ßµÄ¿ª·¢Ð§ÂʺÍÍŶÓÕ½¶·Á¦¡£
Ò ......
»ùÓÚPHPµÄÍøÉÏÉ̳ǹÜÀíÐÅϢϵͳ·ÖÎöÓëÉè¼Æ
Ò»¡¢ (±³¾°½éÉÜ)Ñ¡ÌâÒÀ¾Ý¼°¼ÛÖµ£º
2008ÄêÏ°ëÄê,È«ÇòÐԵĽðÈÚΣ»ú±¬·¢,ÂûÑÓÖÁ¸÷¸ö²úÒµ¼°ÁìÓò,Õâ´Î¾¼ÃµÄ´óÏôÌõÈÃÎÒ¿´µ½µÄÊÇ»úÓö,ÖйúÔÚÕâ´Î¾¼ÃΣ»úÖÐÏÔʾÁ˲»·²µÄʵÁ¦Ó뷢չDZÁ¦,µ±ÆóÒµÃæÁÙÀ§¾³µÄʱºò,×îÏÈÏëµ½µÄÊÇÈçºÎËõ¼õÉÌÒµ³É±¾,±ÈÈç²ÃÔ±½µÐ½,Ëæ×ÅÍøÂç ......