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

PHPÀàʵÀý½Ì³Ì£¨¶þÊ®Èý£©£ºPHP³éÏóÀàʵÏÖ½Ó¿Ú

<p>³éÏóÀàʵÏÖ½Ó¿Ú£¬¿ÉÒÔ²»ÊµÏÖÆäÖеijéÏó·½·¨£¬¶ø½«³éÏó·½·¨µÄʵÏÖ½»¸¶¸ø¾ßÌåÄܱ»ÊµÀý»¯µÄÀàÈ¥´¦Àí¡£</p>
<textarea name="code" class="php">
<?php
interface User
{
 function getName();
 function setName($_name);
}
 //´Ë´¦Ö»ÊÇʵÏÖÁËÒ»¸ö½Ó¿ÚµÄÒ»¸ö·½·¨
abstract class abatractNormalUser implements User
{
 protected $name;
 function getName() {
  return $this->name;
 }
}
 //ÕâÀïʵÏÖÁ˽ӿڵÄÁíÍâÒ»¸ö·½·¨
class NormalUser extends abatractNormalUser
{
 function setName($_name) {
  $this->name = $_name;
 }
}
$normaluser = new NormalUser();
$normaluser->setName("tom");
echo "name is " . $normaluser->getName();
?>
</textarea>


Ïà¹ØÎĵµ£º

PHPÖеÄʵÏÖRegistryģʽ¹ý³ÌÖеÄÁìÎò

<?php
/*
Singleton && Registry Design Pattern Implementation
*/
class Registry {
private $_store = array();
public function getInstance() {
static $instance = array();
if (!$instance) {
$instance[0] = new ......

PHP±àÂëÎÊÌâ

ÀÏÉù³¤Ì¸£¬×ÅÊÇÀ§»óºÜ¶àÈ˵ÄÎÊÌ⣬Èç¹û´¦Àí²»ºÃ£¬¶¼ÊÇÂÒÂ룬˵ÕâЩ»°²¢²»ÊÇÎÒ¶Ô±àÂëºÜ¾«Í¨£¬Ö»ÊÇÔÚÕâ·½ÃæÊǵÃÁôÉñ£¬×Ô¼º×ܽáÁËÒ»µãС¾­Ñé(ÈÝÒ׳öÏÖÂÒÂëµÄµØ·½ÓÐphpÎļþÀïÃæ£¬Êý¾Ý¿âÀïÃæ£¬Ò³ÃæÏÔʾ):
1.ÔÚÓÚÊý¾Ý´ò½»µÀµÄʱºòmysql_query("set names 'utf-8'");
2.ÔÚ½¨Êý¾Ý¿âµÄʱºò£¬ÓÈÆäÊÇÓÃphpMyAdminÓëMYSQL´ò½»µÀʱºò£¬ ......

PHPÀàʵÀý½Ì³Ì£¨Ê®¶þ£©£ºÀàÖÐparent::¹Ø¼ü×Ö

PHP5ÖÐʹÓÃparent::À´ÒýÓø¸ÀàµÄ·½·¨¡£ parent:: ¿ÉÓÃÓÚµ÷Óø¸ÀàÖж¨ÒåµÄ³ÉÔ±·½·¨¡£parent::µÄ×·Ëݲ»½öÓÚÖ±½Ó¸¸Àà¡£
ͨ¹ýparent::µ÷Óø¸Àà·½·¨
<!-- ÉùÃ÷Ò»¸öÔ±¹¤Àà,¾­ÀíÀà¼Ì³Ð×ÔÔ±¹¤Àà -->
<?php
class employee
{
protected $sal = 3000;
public function getSal() {
$this->sal = $this-> ......

PHPÀàʵÀý½Ì³Ì£¨Ê®ËÄ£©£ºÉè¼ÆÄ£Ê½Ö®µ¥¼þģʽ

µ¥¼þģʽҪ½â¾öµÄÎÊÌâ¾ÍÊÇ“ÈçºÎÈÃÕâ¸öÀàÖ»ÓÐÒ»¸öʵÀý”¡£
ÎÒÃǵÄwebÓ¦ÓÃÖУ¬´óÁ¿Ê¹ÓÃÁËÊý¾Ý¿âÁ¬½Ó£¬Èç¹û·´¸´½¨Á¢ÓëÊý¾Ý¿âµÄÁ¬½Ó±ØÈ»ÏûºÄ¸ü¶àµÄϵͳ×ÊÔ´¡£
ÎÒÃÇÈçºÎ½â¾öÕâ¸öÎÊÌ⣬½¨Á¢Î¨Ò»µÄÊý¾Ý¿âÁ¬½ÓÊDZØÒªµÄ·½Ê½¡£
ÎÒÃÇÓÖÈçºÎÖªµÀÓëÕâ¸öÊý¾Ý¿âµÄÁ¬½ÓÊÇ·ñÒѾ­½¨Á¢£¿ »¹ÊÇÐèÒªÏÖÔÚ½¨Á¢£¿
µ¥¼þģʽ¿ÉÒÔ½â¾öÕ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ