随笔分类 -  PHP

摘要:<?php class Base { public function sayHello() { echo 'Hello '; }} trait SayWorld { public function sayHello() { parent::sayHello();//先调用父类的sayHello ec 阅读全文
posted @ 2019-10-10 22:41 牛粪也香 阅读(283) 评论(0) 推荐(0)
摘要:Wamp的下载:64位的下载地址:https://nchc.dl.sourceforge.net/project/wampserver/WampServer%203/WampServer%203.0.0/wampserver3.1.9_x64.exe32位的下载地址:https://versaweb 阅读全文
posted @ 2019-08-29 23:31 牛粪也香 阅读(382) 评论(0) 推荐(0)
摘要:主要用于,在大对象创建时,进行克隆,这样子就不用再初始化创建对象了!<?phpdefine('BASEDIR',__DIR__);echo " 空间命名和自动引入类文件 更进一步 \n";include BASEDIR."/Mooc/Loader.php";//引入一个能载入全部类的文件spl_au 阅读全文
posted @ 2019-04-23 11:32 牛粪也香 阅读(332) 评论(0) 推荐(0)
摘要:用处:以前的一个类做一件事,而当需要做多件事的时候,就需要在同一个类中,改N多代码, 不便于维护和扩展,偶合依赖太强然后,就有了观察者模式逻辑图:1、在原始类中,调用一个,父类中的一个方法notify()继承下来的; 此方法用于显示,所用的模板。2、建立一个抽象类,在其中,创建两个方法addobse 阅读全文
posted @ 2019-04-22 11:39 牛粪也香 阅读(400) 评论(0) 推荐(0)
摘要:<?phpdefine("BASDIR",__DIR__);include BASDIR."/Phpclass/Loader.php";spl_autoload_register("\\Phpclass\\Loader::autoload_rege");class Page{ function in 阅读全文
posted @ 2019-04-22 00:15 牛粪也香 阅读(311) 评论(0) 推荐(0)
摘要:<?phpdefine("BASDIR",__DIR__);include BASDIR."/Phpclass/Loader.php";spl_autoload_register("\\Phpclass\\Loader::autoload_rege");$user = new \Phpclass\U 阅读全文
posted @ 2019-04-21 23:02 牛粪也香 阅读(2606) 评论(0) 推荐(0)
摘要:<?phpdefine("BASDIR",__DIR__);include BASDIR."/Phpclass/Loader.php";spl_autoload_register("\\Phpclass\\Loader::autoload_rege");class page{ protected $ 阅读全文
posted @ 2019-04-21 15:16 牛粪也香 阅读(286) 评论(0) 推荐(0)
摘要:<?phpdefine("BASDIR",__DIR__);include BASDIR."/Phpclass/Loader.php";spl_autoload_register("\\Phpclass\\Loader::autoload_rege");$mysqli= new \Phpclass\ 阅读全文
posted @ 2019-04-21 11:20 牛粪也香 阅读(523) 评论(0) 推荐(0)
摘要:<?phpdefine("BASDIR",__DIR__);include BASDIR."/Phpclass/Loader.php";spl_autoload_register("\\Phpclass\\Loader::autoload_rege");//$db= new \Phpclass\Fa 阅读全文
posted @ 2019-04-20 23:27 牛粪也香 阅读(254) 评论(0) 推荐(0)
摘要:<?phpdefine("BASDIR",__DIR__);include BASDIR."/Phpclass/Loader.php";spl_autoload_register("\\Phpclass\\Loader::autoload_rege");\Phpclass\Gener::test() 阅读全文
posted @ 2019-04-20 23:21 牛粪也香 阅读(186) 评论(0) 推荐(0)
摘要:<?php header('content-type:text/html;charset=utf-8');date_default_timezone_set('Asia/Shanghai');echo date_default_timezone_get(); //date(Y/M/d); // // 阅读全文
posted @ 2019-03-06 17:40 牛粪也香 阅读(228) 评论(0) 推荐(0)
摘要:<?phpheader('content-type:text/html;charset=utf-8');// array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)foreach (range(0, 12) as $number) { echo $number 阅读全文
posted @ 2019-03-06 17:38 牛粪也香 阅读(178) 评论(0) 推荐(0)
摘要:<?php$array=array(1,2,3,4,5,6);function test1(&$var){ $var*=3;}$res=array_walk($array,"test1");//array_walk(array,funcname);print_r($res);print_r($arr 阅读全文
posted @ 2019-03-06 17:32 牛粪也香 阅读(185) 评论(0) 推荐(0)