ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

5-3-2 print() ¨ç¼Æ

5-3-2 print() ¨ç¼Æ

5-3-2   print() ¨ç¼Æ
print()¡G¤]¬O¥Î¨Ó¿é¥X¸ê®Æªº¡A¥Îªk¤]¦p¦Pecho()¤@¯ë¡G
  1. <?
  2. print "¤j®a¨Ó¾ÇPHP";
  3. print "<hr>";
  4. ?>
  5. <?="¤µ¤Ñ¬O:"?>
  6. <?
  7. print "<font color=\"#FF0000\">" . date("Y¦~m¤ëj¤é");
  8. ?>
½Æ»s¥N½X
print()ÁöµM¥i¥H±N¸ê®Æ¿é¥X¨ìºô­¶µe­±¤¤¡A¦ýecho()¥i¥H§Q¥Î¡u¡A¡v³r¸¹¨Ó¦X¨Ö¦C¦L¦h¶µ¸ê®Æ¡Aprint()«o°µ¤£¨ì¡G
  1. <?
  2. $x="§Ú·R";
  3. $y="PHP";
  4. echo $x . $y; //¦L¥X'§Ú·Rphp'
  5. echo $x,"PHP"; //¦L¥X'§Ú·Rphp'
  6. print $x . $y; //¦L¥X'§Ú·Rphp'
  7. print $x,$y;  //¿ù»~,print()¤£»{ÃÑ','³r¸¹
  8. ?>
½Æ»s¥N½X
¥H¤W¨Ò¨Ó¬Ý¡Aprint()¦ü¥G¤£¦pecho()¦³¥Î¡A¨Æ¹ê¤£µM¡Aprint()¦³¥¦¯S§Oªº§@¥Î¡Aecho()¥uºÞ±N¸ê®Æ°µ¿é¥Xªº°Ê§@¡A¸ê®Æ¦³¨S¦³¥¿½Tªº¿é¥X¡Aecho()¨Ã¤£·|§i¶D±z¡A¦Óprint()¦b°µ¸ê®Æ¿é¥Xªº°Ê§@«á¡A·|¦³¦^¶Ç­È¡A³qª¾§Ú­Ì¸ê®Æ¬O§_¤w¥¿½Tªº¿é¥X¡G
  1. <?
  2. $x="§Ú·R";
  3. $y="PHP";
  4. $test=print $x . $y; //¦L¥X'§Ú·Rphp'
  5. print $test; //¸ê®Æ¿é¥X¦¨¥\¦^¶Ç1
  6. ?>
½Æ»s¥N½X
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

        ÀR«ä¦Û¦b : ¸Ü¦h¤£¦p¸Ü¤Ö¡A¸Ü¤Ö¤£¦p¸Ü¦n¡C
ªð¦^¦Cªí ¤W¤@¥DÃD