1. 开机启动nginx:
在 /Library/LaunchDaemons/ 目录新建 org.macports.nginx.plist 文件:
[codesyntax lang="xml"]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC -//Apple ...
[codesyntax lang="php"]
$input1 = [
[
'id' => 4,
'name' => '44'
],
[
'id' => 2,
'name' => '22'
],
[
'id' => 3,
...
array_filter — 用回调函数过滤数组中的单元
[codesyntax lang="php"]
$input = [
[
'id' => 1,
'name' => '11'
],
[
'id' => 2,
'name' =>...
[codesyntax lang="php"]
$a1=array("Pluto","Fido","Missy");
array_multisort($a1,SORT_ASC);
print_r($a1);
[/codesyntax]
打印结果:
[codesyntax lang="php"]
Array
(
[0] =>...
[codesyntax lang="php"]
//产生一个10000的一个数组。
$max = 10000;
$test_arr = range(0, $max);
$temp = 0;
//我们分别用三种方法测试求这些数加上1的值的时间。
// for 的方法
$t1 = microtime(tru...
[codesyntax lang="php"]
header('content-type:text/html;charset=utf-8');
//生命一个计算脚本运行时间的类
class Timer
{
private $startTime = 0; //保存脚本开始执行时的时间(以微秒的形式保存...
array_udiff — 用回调函数比较数据来计算数组的差集
[codesyntax lang="php"]
array array_udiff ( array $array1 , array $array2 [, array $... ], callable $value_compare_func )
[/codesyntax]
使用回调...
在日常工作中,我们会有时会开慢查询去记录一些执行时间比较久的SQL语句,找出这些SQL语句并不意味着完事了,些时我们常常用到explain这个命令来查看一个这些SQL语句的执行计划,查看该SQL语句有没有使用上了索引...
[codesyntax lang="php"]
<?php
class Time
{
/**
* 返回今日开始和结束的时间戳
*
* @return array
*/
public static function today()
{
return [
...
将请求存入redis为了模拟多个用户的请求,使用一个for循环替代
[codesyntax lang="php"]
//redis数据入队操作
$redis = new Redis();
$redis->connect('127.0.0.1',6379);
for($i=0;$i<50;$i+...