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

php´òÓ¡º¯Êý¼¯ºÏ

 
1 echo();2 print();3 die();4 printf();5 sprintf();6 print_r();7 var_dump();
1 echo()
  ¿ÉÒÔͬʱÊä³ö¶à¸ö×Ö·û´®,¿ÉÒÔ¶à¸ö²ÎÊý,²¢²»ÐèÒªÔ²À¨ºÅ,ÎÞ·µ»ØÖµ¡£
2 print()
  Ö»¿ÉÒÔͬʱÊä³öÒ»¸ö×Ö·û´®£¬Ò»¸ö²ÎÊý,ÐèÒªÔ²À¨ºÅ,Óзµ»ØÖµ,µ±ÆäÖ´ÐÐʧ°Üʱ·µflase .print  µÄÓ÷¨ºÍCÓïÑÔºÜÏñ£¬ËùÒÔ»á¶ÔÊä³öÄÚÈÝÀïµÄ%×öÌØÊâ½âÊÍ¡£
3 die();
   ÓÐÁ½¸ö¹¦ÄÜ£ºÏÈÊä³öÄÚÈÝ£¬È»ºóÍ˳ö³ÌÐò¡££¨³£ÓÃÔÚÁ´½Ó·þÎñÆ÷£¬Êý¾Ý¿â£©
   mysql_connect("locahost","root","root") or die("Á´½Ó·þÎñÆ÷ʧ°Ü£¡");
4 printf();
   printf("²ÎÊý1",²ÎÊý2)£º²ÎÊý1=°´Ê²Ã´¸ñʽÊä³ö£»²ÎÊý2=Êä³öµÄ±äÁ¿¡£($s:°´×Ö·û´®;$d:°´ÕûÐÍ;$b:°´¶þ½øÖÆ£»$x:°´16½øÖÆ£»$o:°´°Ë½øÖÆ; $f:°´¸¡µãÐÍ)
   <?php
     $num=100.001;
     printf("%d",$num);  //100
     printf("%s",$num);  //100.001
     printf("%s---%d---%b---%x---%o---%f",$num,$num,$num,$num,$num,$num)
     //100.001---100---1100100---64---144---1001.00100
     printf("%.2f",$num);  //100.00 (СÊýµã±£Áô2λ)
     printf("%.1f",$num);  //100.0 (СÊýµã±£Áô1λ)
     printf("%`#10s",$num); //###100.001
     printf("%`@10s",$num); //@@@100.001
     printf("%`_10s",$num); //___100.001
     printf("%`#-10s",$num); //100.001###
     printf("%`@-10s",$num); //100.001@@@
     printf("%`_-10s",$num); //100.001___
     printf("%`#20s",$num); //#############100.001
   ?>
5 sprintf();
   ´Ë²¢²»ÄÜÖ±½ÓÊä³ö,Ïȸ³¸øÒ»¸ö±äÁ¿£¬È»ºóÔÙÊä³ö±äÁ¿¡£
   <?php
     $num=100.001;
     $a=sprintf("%d",$num);
     echo $a;  //100
    ?>
6 print_r();
   ¹¦ÄÜ£ºÖ»ÓÃÓÚÊä³öÊý×é¡£
7


Ïà¹ØÎĵµ£º

php°²×°³ÌÐòÖÆ×÷¼Ç¼

php°²×°³ÌÐòÔ­Àí£º
   ÆäʵPHP³ÌÐòµÄ°²×°Ô­ÀíÎ޷ǾÍÊǽ«Êý¾Ý¿â½á¹¹ºÍÄÚÈݵ¼Èëµ½ÏàÓ¦µÄÊý¾Ý¿âÖУ¬´ÓÕâ¸ö¹ý³ÌÖÐÖØÐÂÅäÖÃÁ¬½ÓÊý¾Ý¿âµÄ²ÎÊýºÍÎļþ£¬ÎªÁ˱£Ö¤²»±»±ðÈ˶ñÒâʹÓð²×°Îļþ£¬µ±°²×°Íê³ÉºóÐèÒªÐ޸ݲװÎļþ¡£
²½Ö裺
¼ì²éĿ¼»òÎļþµÄȨÏÞ
Ð޸ĻòÌî¼ÓÅäÖÃÎļþ
¼ì²éÅäÖÃÎļþÕýÈ·ÐÔ
µ¼ÈëÊý¾Ý¿â
Ëø¶¨»òÉ ......

php stdClass


ÎÊÌ⣺
ÄãÏë´´½¨Ò»¸ö¶ÔÏ󣬲¢ÔÚÆäÖÐÌí¼ÓһЩÊôÐÔ£¬µ«ÊÇÄãÈ´²»Ïë°ÑËü×÷Ϊһ¸öÃ÷È·µÄÀàÕýʽµØ¶¨ÒåËü¡£ÕâÒ»µãÔÚһЩÇé¿öÏÂÊÇÏ൱ÓÐÓõģ¬ÀýÈçµ±ÄãÐèÒª¶¨ÒåÒ»¸ö·½·¨À´·µ»Ø´øÓÐijЩÊôÐÔ£¨²»È·¶¨µÄ£©µÄ¶ÔÏóʱ£¬¾ÍÈçͬ´Ómysql_fetch_object( ) »òÕß imap_header( )µÄʹÓÃÒ»Ñù¡£
һάÊý×é,ÎÒÏÖÔÚÌرðϲ»¶°ÑËüд³É¶ÔÏó,ÒòΪ¼üÅÌ´ ......

½²½²phpµÄħÊõ·½·¨

PHP5.0ºó£¬phpÃæÏò¶ÔÏóÌá³É¸ü¶à·½·¨£¬Ê¹µÃphp¸ü¼ÓµÄÇ¿´ó£¡£¡
һЩÔÚPHP½ÐħÊõ·½·¨µÄº¯Êý£¬ÔÚÕâÀï½éÉÜһϣºÆäʵÔÚÒ»°ãµÄÓ¦ÓÃÖУ¬ÎÒÃǶ¼ÐèÒªÓõ½ËûÃÇ£¡£¡
1.__construct() µ±ÊµÀý»¯Ò»¸ö¶ÔÏóµÄʱºò£¬Õâ¸ö¶ÔÏóµÄÕâ¸ö·½·¨Ê×Ïȱ»µ÷Óá£
Java´úÂë
class Test { function __construct() { ec ......

php¶ÁÊý¾Ý¿âÂÒÂë

<?php
// Á¬½Ó£¬Ñ¡ÔñÊý¾Ý¿â
$dbconn = pg_connect("host=localhost dbname=publishing user=www password=foo")
    or die('Could not connect: ' . pg_last_error());
// Ö´ÐÐ SQL ²éѯ
$query = 'SELECT * from authors';
$result = pg_query($query) or die('Query failed: ' . pg_last_error( ......

linux PHP »·¾³´î½¨

Ò»¡¢µÇ½
1.½øÈëlinux
2.̞: root
3.¿ÚÁî:123456
4.mysql Óû§Ãû root ÃÜÂë 123456
¶þ¡¢Æô¶¯mysqlÓëapache·þÎñ
1.Æô¶¯mysqÊý¾Ý¿â:/usr/local/mysql/bin/./mysqld_safe --user=mysql &
2.Í£Ö¹mysqlÊý¾Ý¿â:/usr/local/mysql/bin/mysqladmin -u root -p shutdown
3.Æô¶¯apache: /usr/local/apache2/bin/./ap ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ