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

php stdClass


ÎÊÌ⣺
ÄãÏë´´½¨Ò»¸ö¶ÔÏ󣬲¢ÔÚÆäÖÐÌí¼ÓһЩÊôÐÔ£¬µ«ÊÇÄãÈ´²»Ïë°ÑËü×÷Ϊһ¸öÃ÷È·µÄÀàÕýʽµØ¶¨ÒåËü¡£ÕâÒ»µãÔÚһЩÇé¿öÏÂÊÇÏ൱ÓÐÓõģ¬ÀýÈçµ±ÄãÐèÒª¶¨ÒåÒ»¸ö·½·¨À´·µ»Ø´øÓÐijЩÊôÐÔ£¨²»È·¶¨µÄ£©µÄ¶ÔÏóʱ£¬¾ÍÈçͬ´Ómysql_fetch_object( ) »òÕß imap_header( )µÄʹÓÃÒ»Ñù¡£
һάÊý×é,ÎÒÏÖÔÚÌرðϲ»¶°ÑËüд³É¶ÔÏó,ÒòΪ¼üÅÌ´òÆðÀ´±È½Ï˳ÊÖ,¿´ÆðÀ´Ò²Ë³ÑÛ,Èç
$andy = array();
$andy['a'] = 1;
$andy['b'] = 2;
$andy['c'] = 3;
ÎÒϲ»¶°ÑËü±ä³ÉÕâÑù
$andy = array();
$andy = (object)$andy;
$andy->a = 1;
$andy->b = 2;
$andy->c = 3;
н¨¿ÕÊý×éÖ»Òª$andy = array();
н¨¿Õ¶ÔÏñÈ´Òª$andy = new Andy; ¶øÇÒ»¹µÃÏÈÓиöclass Andy{}
»òÕßµÃ2ÐÐ
$andy = array();
$andy = (object)$andy;
ÓÃarrayÖ±½Ó¸ÄÀàÐͳÉobjectÓеã±ðŤ,½ñÌìÕÒµ½ÁË´ð°¸,¸ÐлphpxµÄÐÖµÜ
====================================================================
˳±ãתһÏÂstdClassµÄ½éÉÜ
$user = new stdClass();
$user->name = 'gouki';
ÕâÑùµÄ´úÂ룬ÕâÊǸÉÂïÓõÄÄØ£¿
·­¿ªÊֲᣬËÑË÷stdClass£¬Äã»á·¢ÏÖ£¬ÊÖ²áÉϼ¸ºõûÓнéÉÜ£¬Èç¹ûÄãÔÙ´ÎËÑË÷google£¬¿´µ½µÄÒ²¼¸ºõÈ«ÊÇÓ¢ÎĽâÊÍ¡£
Æäʵ£¬stdClassÔÚPHP5²Å¿ªÊ¼±»Á÷ÐС£¶østdClassÒ²ÊÇzendµÄÒ»¸ö±£ÁôÀà¡£ËƺõûÓÐÆäËû×÷Óá£Ò²¼¸ºõûÓÐÈκÎ˵Ã÷¡£
»òÕߣ¬ÎÒÃÇ¿ÉÒÔÕâôÀí½â£ºstdClassÊÇPHPµÄÒ»¸ö»ùÀ࣬ËùÓеÄÀ༸ºõ¶¼¼Ì³ÐÕâ¸öÀ࣬ËùÒÔÈκÎʱºò¶¼¿ÉÒÔ±»new£¬¿ÉÒÔÈÃÕâ¸ö±äÁ¿³ÉΪһ¸öobject¡£Í¬Ê±£¬Õâ¸ö»ùÀàÓÖÓÐÒ»¸öÌØÊâµÄµØ·½£¬¾ÍÊÇûÓз½·¨¡£
·²Ê±ÓÃnew stdClass()µÄ±äÁ¿£¬¶¼²»¿ÉÄÜ»á³öÏÖ$a->test()ÕâÖÖ·½Ê½µÄʹÓá£
»òÕߣ¬ÎÒÃÇ¿ÉÒÔÓÖÕâôÀí½âһϣ¬ÕýÒòΪPHP5µÄ¶ÔÏóµÄ¶ÀÌØÐÔ£¬¶ÔÏóÔÚÈκεط½±»µ÷Ó㬶¼ÊÇÒýÓõØÖ·Ð͵ģ¬ËùÒÔÏà¶ÔÏûºÄµÄ×ÊÔ´»áÉÙÒ»µã¡£ÔÚÆäËüÒ³ÃæΪËü¸³ÖµÊ±ÊÇÖ±½ÓÐ޸ģ¬¶ø²»ÊÇÒýÓÃÒ»¸ö¿½±´¡£
ÀýÈ磺
$user = new stdClass();
$user->name = 'gouki';
$myUser = $user;
$myUser->name = 'flypig';
Èç¹ûÔÚPHP4ʱ´ú£¬ÕâÑùµÄ´úÂë¾ÍÊÇÔÚÏûºÄϵͳ×ÊÔ´¡£ÒòΪ£º
$myUser = $user;
ÕâÊÇ´´½¨ÁËÒ»¸ö¿½±´¡£ËùÒÔ£¬ÔÚPHP4µÄʱºò£¬¶¼ÊÇÕâÑùʹÓãº
$myUser = & $user;
ÓÐÈË˵£¬ÎªÊ²Ã´²»ÓÃÊý×éÄØ£¿Êý×é²»ÊǸü·½±ãÂ𣿶øÇÒ¶ÔÓÚPHPÕâÑùµÄÈõÀàÐͳÌÐòÀ´Ëµ£¬ÓÃÊý×éÓ¦¸ÃÊÇ×î·½±ãµÄ¡£
ȷʵ¡£Êý×éÔÚ³ÌÐòµÄʹÓÃÖÐÓ¦¸ÃÊÇ×î·½±ãµÄ£¬È»¶øÊý×éµÄÿ´Î±»ÒýÓã¨$a = $b£©£¬Æäʵ¶¼ÊÇ´´½¨ÁËÒ»¸ö¸±±


Ïà¹ØÎĵµ£º

Éý»ªÌṩÖÕÉíÃâ·ÑASP+access PHP+mysqlÐéÄâÖ÷»ú

Éý»ªÌṩÖÕÉíÃâ·ÑASP+access PHP+mysqlÐéÄâÖ÷»ú
Ò»£ºÉý»ªÍøÂç¿Æ¼¼ÓÐÏÞ¹«Ë¾,ÓëÉý»ªÍ¬ÔÚÕ¾³¤ÖÕÉíÃâ·Ñ¿Õ¼ä·ö³Ö¼Æ»®.
1¡¢×ð¾´µÄÓû§ÄúºÃ,Ò²ÐíÄú»¹ÔÚΪÿÄêÒ»½»µÄ¿Õ¼ä·ÑÓ÷¢³î,Ò²ÐíÄúÏë»ñµÃÒ»¸ö¸üÓÅÖʵĿռäÈ´²»ÏëͶÈëÌ«¶à,´ÓÏÖÔÚÆð ÕâЩÎÊÌ⽫ӭÈжø½â→Éý»ªÍøÂç←ÓëÉý»ªÍ¬ÔÚÕ¾³¤·ö³Ö¼Æ»®È«ÃæÆô¶¯¡£
2¡¢Ã»ÓÐ×¢²á¹«Ë¾ ......

Ê®Ììѧ»áphpÖ®µÚ°ËÌì

 Ñ§Ï°Ä¿µÄ£º×öÒ»¸ö·ÖÒ³ÏÔʾ
¡¡¡¡¹Ø¼ü¾ÍÊÇÓõ½ÁËSQLÓï¾äÖеÄlimitÀ´ÏÞ¶¨ÏÔʾµÄ¼Ç¼´Ó¼¸µ½¼¸¡£ÎÒÃÇÐèÒªÒ»¸ö¼Ç¼µ±Ç°Ò³µÄ±äÁ¿$page£¬»¹ÐèÒª×ܹ²µÄ¼Ç¼Êý$num
¡¡¡¡¶ÔÓÚ$pageÈç¹ûûÓÐÎÒÃǾÍÈÃËü=0£¬Èç¹ûÓÐ<0¾ÍÈÃËüÒ²=0£¬Èç¹û³¬¹ýÁË×ܵÄÒ³Êý¾ÍÈÃËû=×ܵÄÒ³Êý¡£
¡¡¡¡$execc="select count(*) from tablename ";
¡¡¡¡$re ......

phpÐÂÎÅÄÚÈÝ·ÖҳʵÀý£¨smarty Ä£°å£©

ÏîÄ¿ÐèÒªÓõ½ ÐÂÎÅÄÚÈÝÒ³ ʵÏÖ·ÖÒ³¹¦ÄÜ£¬Ëæ±ãдÁËһϡ£
¸ø´ó¼Ò×ö¸ö²Î¿¼£¬Ð´µÄ²»ºÃ»¹ÍûÁ½Ⱑ£¡
//ÐÂÎÅÄÚÈÝ·ÖÒ³¿ªÊ¼ The page next for news content start
$nextpage="<!--{nextpage}-->";//·ÖÒ³±êʾ.
$content=explode($nextpage,$content);
$sum=count($content);
$mpurl=$_SERVER['PHP_SELF']."?newsid ......

phpÖУ¬¹ØÓÚÕû³ýµÄ3¸öº¯Êý2008

phpÖУ¬¹ØÓÚÕû³ýµÄ3¸öº¯Êý
2008-10-23 23:25
Ceil: ¼ÆËã´óÓÚÖ¸¶¨ÊýµÄ×îСÕûÊý¡£
Floor: ¼ÆËãСÓÚÖ¸¶¨ÊýµÄ×î´óÕûÊý¡£
round: ËÄÉáÎåÈë¡£
¸ù¾ÝÐèҪѡÓÃ
<?php
$a=20;
$b = 6;
echo ($a/$b)."<br>"; //out 3.3333333333333
echo ceil($a/$b)."<br>"; //out 4
echo floor($a/$b)."<br> ......

ÔÝʱ½â¾öPHPÁ¬½ÓSQLserver2005ÂÒÂëÎÊÌâ.

Êý¾Ý¿âÊÇsqlserver2005,Êý¾Ý´æ´¢µÄ¾ßÌå±àÂë²»Ïê. µ½ÍøÉÏÕÒÁ˶ÎתÂ뺯Êý /*        ¶¨Òå×Ö·ûת»»º¯Êý£¬½â¾ömssqlÖÐÎÄÂÒÂëÎÊÌâ            */
function convert2utf8($string)
     {
  ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ