摘要: 1、使用file 函数直接读取 $starttime = microtime_float(); ini_set('memory_limit','-1'); $file = "testfile.txt"; $data = file($file); $line = count($data);//总行数 阅读全文
posted @ 2016-03-03 17:25 北京流浪儿 阅读(469) 评论(0) 推荐(0)
摘要: 1、工厂模式 <?php namespace Facebab; class Factory { static function createDatabase () { return new Database(); } } $db = Facebab\Factory::createDatabase() 阅读全文
posted @ 2016-03-03 10:50 北京流浪儿 阅读(253) 评论(0) 推荐(0)
摘要: 1、自动装载实例 目录下有3个文件:index.php load.php tests文件夹 tests文件夹里有 test1.php <?php namespace Tests; class Test1{ static function test(){ echo __CLASS__.'<br>'; 阅读全文
posted @ 2016-03-03 10:32 北京流浪儿 阅读(208) 评论(0) 推荐(0)