自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(110)
  • 收藏
  • 关注

原创 -bash: rz: command not found的解决方法

执行命令安装 apt-get install lrzszroot@60b97cab767c:/usr/local/src# apt-get install lrzszReading package lists... DoneBuilding dependency tree Reading state information... DoneSuggested packages: minicomThe following NEW packages will be installe

2022-03-25 17:03:55 765

原创 Ubuntu安装docker

1. 安装依赖包apt-get install apt-transport-https curl ca-certificates software-properties-common2. 添加docker官方GPG keycurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -3. 配资stable仓库add-apt-repository "deb [arch=amd64] https:

2022-03-25 16:26:14 213

原创 源码安装nginx

1. 下载nginx安装包wget http://nginx.org/download/nginx-1.20.2.tar.gz2. 安装依赖包apt-get install makeapt-get install gcc g++apt-get install libpcre3 libpcre3-devapt-get install zlib1g zlib1g-devapt-get install openssl libssl-dev3.解压,编译安装tar -xvf ngi

2022-03-21 11:42:49 3442

原创 nginx安装参数

root@60b97cab767c:/usr/local/src/nginx-1.20.2# ./configure --help --help print this message --prefix=PATH set installation prefix --sbin-path=PATH set nginx binary pathname --mod.

2022-03-21 10:51:38 396

原创 redis主从搭建

1. 准备工作三台服务器服务器ip 角色 172.17.0.2 主 172.17.0.3 从 172.17.0.4 从 2. docker安装redisdocker pull redis3. 运行主172.17.0.2执行:docker run -itd -p 6379:6379 --name redis_master redis:lastestdocker exec -it redis_master /bin/bash从172.17.

2022-03-17 16:32:02 1431

原创 查看当前ubuntu的版本

查看当前ubuntu的版本,命令:cat /etc/lsb-release示例:root@wl:~# cat /etc/lsb-releaseDISTRIB_ID=UbuntuDISTRIB_RELEASE=16.04DISTRIB_CODENAME=xenialDISTRIB_DESCRIPTION="Ubuntu 16.04.6 LTS"root@wl:~#

2022-03-11 10:54:55 361

原创 五十七、逐行阅读Yii2.0.43_Yii框架文件yii\web\UrlManager.php(2)

1. init方法,初始化UrlManager // 初始化UrlManager public function init() { parent::init(); if ($this->normalizer !== false) { $this->normalizer = Yii::createObject($this->normalizer); if (!$this->no

2021-12-08 10:23:00 201

原创 PHP函数get_class

get_class返回对象实例的类名称/** * Returns the name of the class of an object * @link https://php.net/manual/en/function.get-class.php * @param object $object [optional] <p> * The tested object. This parameter may be omitted when inside a class. * <

2021-12-08 10:11:04 405

原创 PHP函数header_register_callback

header_register_callback 注册一个函数,在 PHP 开始发送输出时调用。/** * Registers a function that will be called when PHP starts sending output. * The callback is executed just after PHP prepares all headers to be sent,<br> * and before any other output is sent.

2021-12-02 16:02:12 247

原创 五十七、逐行阅读Yii2.0.43_Yii框架文件yii\web\UrlManager.php(1)

yii\web\UrlManager类,解析和创建url,继承yii\base\Component类。一、属性1.$enablePrettyUrl 启用url用户友好化 // 启用url用户友好化 public $enablePrettyUrl = false;2.$enableStrictParsing是否启用严格解析 //是否启用严格解析 public $enableStrictParsing = false;3.$rules 创...

2021-12-02 15:43:21 282

原创 PHP函数version_compare

version_compare比较php的版本/** * Compares two "PHP-standardized" version number strings * @link https://php.net/manual/en/function.version-compare.php * @param string $version1 <p> * First version number. * </p> * @param string $version2 &

2021-11-30 16:38:02 329

原创 PHP函数key_exists

key_exists检查数组是否存在指定键/** * Checks if the given key or index exists in the array. The name of this function is array_key_exists() in PHP > 4.0.6. * @link https://php.net/manual/en/function.array-key-exists.php * @param mixed $key <p> * Value

2021-11-29 17:27:46 590

原创 PHP函数sizeof

sizeof返回数组的长度,是count函数的别名/** * &Alias; <function>count</function> * @link https://php.net/manual/en/function.sizeof.php * @param array|Countable $var * @param int $mode [optional] * @return int */function sizeof($var, $mode = COU.

2021-11-29 17:24:12 118

原创 数据结构-冒泡排序

比较两个相邻的数据,将值大的数据交换到右边 时间复杂度O(n^2) 空间复杂度O(1) 稳定排序一、基础版本$array = [ 5, 1, 6, 7, 9];for ($i = 0; $i < count($array) - 1; $i ++ ) {// 控制冒泡的 轮数 N-1 轮 for ($j = 0; $j < count($array) - $i - 1; $j ++) { // 每轮需要比较的次数 if ($array[$j].

2021-11-26 16:45:36 272

原创 PHP函数pos

pos返回数组当前指针的内容,是current函数的别名/** * &Alias; <function>current</function> * @link https://php.net/manual/en/function.pos.php * @param $arg */function pos(&$arg) { }/** * Return the current element in an array * @link https://p

2021-11-26 16:02:53 114

原创 PHP函数array_key_last

array_key_last返回数组的最后一个键/** * Gets the last key of an array * * Get the last key of the given array without affecting the internal array pointer. * * @link https://secure.php.net/array_key_last * @param array $array An array * @return string|int|

2021-11-26 15:55:42 120

原创 PHP函数array_key_first

array_key_first返回数组的第一个键不影响数组内部指针 php>=7.3可用/** * Gets the first key of an array * * Get the first key of the given array without affecting the internal array pointer. * * @link https://secure.php.net/array_key_first * @param array $array An

2021-11-26 15:53:34 95

原创 PHP函数array_key_exists

array_key_exists判断一个键是否存在/** * Checks if the given key or index exists in the array * @link https://php.net/manual/en/function.array-key-exists.php * @param mixed $key <p> * Value to check. * </p> * @param array|ArrayObject $search &lt

2021-11-26 15:42:43 289

原创 五十六、逐行阅读Yii2.0.43_Yii框架文件yii\base\Response.php

yii\base\Response类是响应请求的基类,继承值yii\base\Component类一、属性1. $exitStatus 退出码 //退出码 public $exitStatus = 0;二、方法1. send方法,发送请求,这是一个空方法,由子类实现具体功能 public function send() { }2. clearOutputBuffers方法,移除输出缓冲 //移除输出缓冲 public f

2021-11-26 15:40:08 73

原创 五十五、逐行阅读Yii2.0.43_Yii框架文件yii\web\Response.php(7)

一、getIsInvalid方法,检查响应码是否无效 //检查响应码是否无效 public function getIsInvalid() { return $this->getStatusCode() < 100 || $this->getStatusCode() >= 600; }二、getIsInformational方法,信息码 public function getIsInforma

2021-11-25 15:43:28 263

原创 PHP函数array_combine

array_combine合并两个数组成为一个新的数组,一个数组用于键,一个数组作为值/** * Creates an array by using one array for keys and another for its values * @link https://php.net/manual/en/function.array-combine.php * @param array $keys <p> * Array of keys to be used. Illegal

2021-11-24 15:34:31 342

原创 五十四、逐行阅读Yii2.0.43_Yii框架文件yii\web\Response.php(6)

一、属性1. $_cookiesCookieCollection实例 //CookieCollection实例 private $_cookies;二、方法1. getCookies方法,返回CookieCollection实例 // 返回CookieCollection实例 public function getCookies() { if ($this->_cookies === null) { .

2021-11-24 15:18:36 283

原创 PHP函数array_chunk

array_chunk将数组按照指定大小分割成多个数组。参数 描述 $input 要分割的数组 $size 分割的大小,指明每个部分应包含的元素个数 $preserve_keys 可选, true保留原始数组的键 false,默认创新新的索引 /** * Split an array into chunks * @link https://php.net/manual/en/function.array-chunk.ph.

2021-11-23 16:05:51 681

原创 PHP函数array_map

array_map将数组中每个元素应用到一个自定义函数,结果保留到一个新的数组中。/** * Applies the callback to the elements of the given arrays * @link https://php.net/manual/en/function.array-map.php * @param callback $callback <p> * Callback function to run for each element in eac

2021-11-23 15:54:18 674

原创 五十三、逐行阅读Yii2.0.43_Yii框架文件yii\web\Response.php(5)

一、redirect方法,重定向 //重定向 public function redirect($url, $statusCode = 302, $checkAjax = true) { if (is_array($url) && isset($url[0])) { // ensure the route is absolute $url[0] = '/' . ltrim($url[0], '/');

2021-11-23 15:42:46 295

原创 PHP函数array_filter

array_filter迭代数组中每个元素到一个自定义函数,保留返回true的值到一个新的结果数组中。/** * Iterates over each value in the <b>array</b> * passing them to the <b>callback</b> function. * If the <b>callback</b> function returns true, the * current v

2021-11-22 16:44:51 2379

原创 五十二、逐行阅读Yii2.0.43_Yii框架文件yii\web\Response.php(4)

一、sendFile方法,发送文件 // 发送文件 public function sendFile($filePath, $attachmentName = null, $options = []) { // mimeType设置 if (!isset($options['mimeType'])) { $options['mimeType'] = FileHelper::getMimeTypeByExtension($fi

2021-11-22 16:26:10 287

原创 PHP函数array_product

array_product计算数组元素的乘积。/** * Calculate the product of values in an array * @link https://php.net/manual/en/function.array-product.php * @param array $array <p> * The array. * </p> * @return int|float the product as an integer or float.

2021-11-22 16:14:38 241

原创 PHP函数array_sum

array_sum计算数组元素的和。如果元素的值都是整数,则返回整数结果 如果元素的值有浮点数,则返回浮点数结果 false,null被转换成 0 true转成1 数组和对象被忽略不参与计算 资源句柄被转换成响应的整型值 字符串被转成响应的数字,不能转换的跳过/** * Calculate the sum of values in an array * @link https://php.net/manual/en/function.array-sum.php * @param a

2021-11-19 14:33:18 881

原创 五十一、逐行阅读Yii2.0.43_Yii框架文件yii\web\Response.php(3)

一、send方法,发送响应 // 发送响应数据到客户端 public function send() { // 已经发送,直接返回 if ($this->isSent) { return; } // 响应发送前事件处理 $this->trigger(self::EVENT_BEFORE_SEND); // 准备阶段 $this-&

2021-11-19 14:17:58 339

原创 PHP函数array_udiff_uassoc

array_udiff_uassoc通过使用自定义函数比较键和值,计算数组的差集/** * Computes the difference of arrays with additional index check, compares data and indexes by a callback function * @link https://php.net/manual/en/function.array-udiff-uassoc.php * @param array $array1 &lt

2021-11-18 17:45:54 80

原创 PHP函数array_diff_uassoc

array_diff_assoc通过使用自定义函数比较键、内建函数比较值,计算数组的差集/** * Computes the difference of arrays with additional index check which is performed by a user supplied callback function * @link https://php.net/manual/en/function.array-diff-uassoc.php * @param array $.

2021-11-18 17:39:35 95

原创 五十、逐行阅读Yii2.0.43_Yii框架文件yii\web\Response.php(2)

一、init方法,组件初始化 //组件初始化 public function init() { // http版本 if ($this->version === null) { if (isset($_SERVER['SERVER_PROTOCOL']) && $_SERVER['SERVER_PROTOCOL'] === 'HTTP/1.0') { $this->

2021-11-18 14:48:21 196

原创 PHP函数array_udiff_assoc

array_udiff_assoc通过使用自定义函数比较值,内建函数比较键,计算数组的差集/** * Computes the difference of arrays with additional index check, compares data by a callback function * @link https://php.net/manual/en/function.array-udiff-assoc.php * @param array $array1 <p>.

2021-11-17 15:04:52 236

原创 PHP函数array_diff_assoc

array_diff_assoc通过比较键和值,计算数组的差集/** * Computes the difference of arrays with additional index check * @link https://php.net/manual/en/function.array-diff-assoc.php * @param array $array1 <p> * The array to compare from * </p> * @param .

2021-11-17 14:58:10 143

原创 四十九、逐行阅读Yii2.0.43_Yii框架文件yii\web\Response.php(1)

yii\web\Response继承yii\base\Response类,表示一个http响应。包含了要发送给客户端的headers,cookies和相应内容。一、3个事件相关的常量 const EVENT_BEFORE_SEND = 'beforeSend'; const EVENT_AFTER_SEND = 'afterSend'; const EVENT_AFTER_PREPARE = 'afterPrepare';二、响应内容格式 //响应内容

2021-11-17 14:52:58 331

原创 PHP函数array_udiff

array_udiff通过自定义函数来比较值,计算数组的差集/** * Computes the difference of arrays by using a callback function for data comparison * @link https://php.net/manual/en/function.array-udiff.php * @param array $array1 <p> * The first array. * </p> * @.

2021-11-16 16:50:21 306

原创 PHP函数array_diff_ukey

array_diff_ukey通过自定义函数来比较键,计算数组的差集/** * Computes the difference of arrays using a callback function on the keys for comparison * @link https://php.net/manual/en/function.array-diff-ukey.php * @param array $array1 <p> * The array to compare fr.

2021-11-16 16:46:28 276

原创 PHP函数array_diff_key

array_diff_key通过比较键,计算数组的差集/** * Computes the difference of arrays using keys for comparison * @link https://php.net/manual/en/function.array-diff-key.php * @param array $array1 <p> * The array to compare from * </p> * @param array $ar

2021-11-16 16:33:39 293

原创 PHP函数array_diff

array_diff通过比较键值,计算数组的差集/** * Computes the difference of arrays * @link https://php.net/manual/en/function.array-diff.php * @param array $array1 <p> * The array to compare from * </p> * @param array $array2 <p> * An array to com

2021-11-16 16:26:02 569

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除