电脑安全

您当前的位置:主页 > 电脑安全 >

闲来无事写个PHP5 OOP模型-网络编程

来源:[db:来源]标题:   comsenz    编辑:电脑技术全能网 时间:2019-09-18 17:59

原标题:闲来无事写个PHP5 OOP模型-网络编程
   <?php/****@categorymytestOOP*@packagenull*@authorRaoHongfu<raohongfu@comsenz.com>*@copyrightmyself*@licensehttp://www.php.net/license/3_0.txtPHPLicense3.0*@versionnull*@linkhttp://blog.sina.com.cn/hongfu08*http://blog.111cn.net/hongfu_**/classmyTest{privatefunctionmyTest(){}static$name=null;static$qq=null;publicfunctiongetInstance(){returnnewmyTest();}publicfunctionsetName($name){$this->name=sprintf("%s",$name);}publicfunctionsetQQ($qq){$this->qq=intval($qq);}publicfunctiongetName(){return$this->name;}publicfunctiongetQQ(){return$this->qq;}publicfunctionexcute(){returnsprintf("MyNameIs<fontcolor=redsize=5>%s</font>ANDMyQQIs<fontcolor=redsize=5>%d</font>",$this->name,$this->qq);}}$obj=myTest::getInstance();$obj->setName(''raohongfu'');$obj->setQq(''59547993'');$name=$obj->getName();$qq=$obj->getQq();var_dump($name,$qq);$result=$obj->excute();print_r($result);?>

上一篇:PHP的其他功能-网络编程

下一篇:没有了