ADSFASFDA

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2017年3月7日

摘要: "hello world", "imooc"=>"http://baidu.com" ); echo $array[key]; //如果不用引号 输出的是http://baidu.com echo $array["key"]; //输出的是"hello world", 阅读全文
posted @ 2017-03-07 02:23 778323309 阅读(142) 评论(0) 推荐(0) 编辑

摘要: 阅读全文
posted @ 2017-03-07 02:21 778323309 阅读(108) 评论(0) 推荐(0) 编辑

摘要: <?php //性能差的 $str='hello world'; for ($i=0;$i<strlen($str);$i++){ //do something } //性能好的 $str='hello world'; $len=strlen($str); for ($i=0;$i<$len;$i++){ //do something } 阅读全文
posted @ 2017-03-07 02:16 778323309 阅读(110) 评论(0) 推荐(0) 编辑

摘要: 4-5 PHP-避免在循环内做运算 阅读全文
posted @ 2017-03-07 02:14 778323309 阅读(108) 评论(0) 推荐(0) 编辑

摘要: php也有内存回收机制,利用unset及时释放内存 unset也有注销不掉的情况 少用正则表达式 正则表达式 会回溯 尽量使用字符串处理函数,实现相同的逻辑 阅读全文
posted @ 2017-03-07 02:11 778323309 阅读(120) 评论(0) 推荐(0) 编辑

摘要: D:\all\phpstudy\Apache\bin>ab -c 10 -n100 www.qzrc.com/ This is ApacheBench, Version 2.3 <$Revision: 1706008 $> Copyright 1996 Adam Twiss, Zeus Techno 阅读全文
posted @ 2017-03-07 01:53 778323309 阅读(161) 评论(0) 推荐(0) 编辑

摘要: 优化点:少写代码,多用php自身能力 性能问题 代码冗长较多,可读性不佳,并且性能低 多使用内置常量 变量 函数 阅读全文
posted @ 2017-03-07 01:38 778323309 阅读(80) 评论(0) 推荐(0) 编辑

该文被密码保护。 阅读全文
posted @ 2017-03-07 01:36 778323309 阅读(1) 评论(0) 推荐(0) 编辑

摘要: <?php class Test{ private $var='123'; public function __get($name) { return $this->var; } } function current_time(){ list($usec,$sec)= explode(' ',mic 阅读全文
posted @ 2017-03-07 01:11 778323309 阅读(95) 评论(0) 推荐(0) 编辑

摘要: <?php $array1=array(); $array2=array(); for ($i=0;$i<rand(1000,2000);$i++){ $array1[]=rand(); } for ($y=0;$y<rand(1000,2000);$y++){ $array2[]=rand(); 阅读全文
posted @ 2017-03-07 00:53 778323309 阅读(237) 评论(0) 推荐(0) 编辑

摘要: <?php header('Content-Type:text/html;charset=utf8'); $_start=current_time(); $array1=range(1000,2000); $i=0; while ($i<200000){ ++$i; // isset($array1 阅读全文
posted @ 2017-03-07 00:46 778323309 阅读(152) 评论(0) 推荐(0) 编辑