摘要:
//数组排序 let arr2 = [3, 5, 1, 7, 9]; arr2.sort(); console.log(arr2); //倒叙排序1 arr2.reverse(); console.log(arr2); //倒叙排列2 arr2.sort((a,b)=>(b-a)); console 阅读全文
摘要:
场景一,根据邮箱登录是一个普遍场景,如果邮箱不加索引则需要全表扫描,而如果加入全量索引则需要占用很大的空间。由于字符串索引支持最左前缀原则,则我们可以这样创建索引: alter table user add index index(email(5)); 这里设置email的最左前5个字符作为索引可以 阅读全文
摘要:
新建一张表: CREATE TABLE `r` ( `id` int NOT NULL primary key auto_increment, `k` int not null, `name` varchar(16), index(k)) ENGINE=InnoDB DEFAULT CHARSET= 阅读全文
摘要:
<?php function demo01($a) { echo $a; } call_user_func("demo01", "hello world"); 输出 1.配合命令行参数使用 <?php //把第一个参数做为回调参数使用 $i = getopt("i:"); $i = $i['i']; 阅读全文
摘要:
1.创建分区表 CREATE TABLE `fs_orders_funds_detail_sp32` ( `id` int(11) NOT NULL AUTO_INCREMENT, `confirm_time` datetime NOT NULL DEFAULT '0000-00-00 00:00: 阅读全文
摘要:
html: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>策略模式</title> </head> <body> <form action='./demo03.php' method="post"> <in 阅读全文
摘要:
<?php //php 可变参数 function concatenate( ...$strings): string { $string = ''; //此时的strings 是一个数组 foreach($strings as $piece) { $string .= $piece; } retu 阅读全文
摘要:
1.返回值类型的声明 <?php //php7新特性 返回值类型的声明 function arraySum (array $arr): array { return array_map(function($value){ return array_sum($value); }, $arr); } v 阅读全文
摘要:
1.sum与if结合使用 如图:数据表中,count_money 字段可为正,可为负。为正表示收入,负表示支出。 统计总收入,总支出。 select sum(if(count_money > 0, count_money, 0)) as sum_receipt, sum(if(count_money 阅读全文
摘要:
查看所有进程 ps -ef ps -ef | grep 查找的进程名 结束进程 ps -ef | grep 查找的进程名 | grep -v grep | awk '{print $2}' | xargs kill -9 阅读全文