上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 23 下一页

2020年12月3日

tp5.1接入支付宝网站支付

摘要: 1.登录支付支付平台[https://opendocs.alipay.com/open/270/106291] 下载对应的sdk 2.将对应的SDK放在对应的tp5.1框架对应的目录 3.因为是外部加载的类库所以要使用composer加载下需要配置composer的配置文件composer.json 阅读全文

posted @ 2020-12-03 20:14 孤灯引路人 阅读(1511) 评论(0) 推荐(0) 编辑

2020年12月2日

go类型转换

摘要: go:interface{}、断言与类型转换 interface{}可用于向函数传递任意类型的变量,但对于函数内部,该变量仍然为interface{}类型(空接口类型), 不清楚这点将可能导致错误。如以下代码: package main import "fmt" /* **用于输出数组元素 */ f 阅读全文

posted @ 2020-12-02 14:46 孤灯引路人 阅读(83) 评论(0) 推荐(0) 编辑

mysql常见sql练习题

摘要: 数据库原始数据如下:数据库名:tbl_clothers 需求是:按照type分组,并获取个分组中price中的最大值,解决sql如下: 思路1: select * from (select type, name, price from tbl_clothers order by price desc 阅读全文

posted @ 2020-12-02 11:21 孤灯引路人 阅读(276) 评论(0) 推荐(0) 编辑

php 获取当前时间的 前一小时、一天、一个月、一年

摘要: //获取本月起始日期 $begindate=date('Y-m-01', strtotime(date("Y-m-d"))); $enddate =date('Y-m-d', strtotime("$begindate +1 month -1 day")); //获取一年前的日期 $begindat 阅读全文

posted @ 2020-12-02 11:16 孤灯引路人 阅读(4064) 评论(0) 推荐(0) 编辑

2020年11月30日

php如何检测是否有环

摘要: 前言 前面几个文章讲了单链表和快慢指针的用法, 这里再延伸一下快慢指针的用法本文讲解三个例子: 给定一个单链表,判断是否有环(链表后部分存在循环,或者就是一个循环链表) 如果有环,找到环的入口 判断两个单链表是否相交 1.判断单链表是否有环 如果一个链表存在循环, 则代表该链表有环,其中,可能是部分 阅读全文

posted @ 2020-11-30 13:43 孤灯引路人 阅读(313) 评论(0) 推荐(0) 编辑

Go的切片:长度和容量

摘要: 一、切片的声明 切片可以看成是数组的引用。在 Go 中,每个数组的大小是固定的,不能随意改变大小,切片可以为数组提供动态增长和缩小的需求,但其本身并不存储任何数据。 /* * 这是一个数组的声明 */ var a [5]int //只指定长度,元素初始化为默认值0 var a [5]int{1,2, 阅读全文

posted @ 2020-11-30 11:51 孤灯引路人 阅读(427) 评论(0) 推荐(0) 编辑

go实现小项目

摘要: 1.家庭记账本【这是面向过程写法】 package main import "fmt" func main() { key:=""; loop:=true; money:=0.0; banacle:=1000.00; notes:=""; details:=""; flag:=false; for 阅读全文

posted @ 2020-11-30 10:29 孤灯引路人 阅读(460) 评论(0) 推荐(0) 编辑

2020年11月28日

使用go语言判断不同数据类型

摘要: 代码演示案例 package main import ( "fmt" ) func TypeCheck(items... interface{}){ for _,item:=range items { switch item.(type) { case bool : fmt.Println("thi 阅读全文

posted @ 2020-11-28 15:02 孤灯引路人 阅读(452) 评论(0) 推荐(0) 编辑

2020年11月26日

go使用接口案例排序

摘要: 一般情况下我们需要对数据进行排序可以使用sort.Ints()方法排序代码 package main import ( "fmt" "math/rand" "sort" ) func main(){ var nums []int; for i:=0;i<10;i++ { num:=rand.Intn 阅读全文

posted @ 2020-11-26 22:08 孤灯引路人 阅读(78) 评论(0) 推荐(0) 编辑

2020年11月25日

go接口使用案例晓demo

摘要: 1.go里面接口必须使用interface 这个案例也体现了多台特性 package main import "fmt" type Usb interface { work() finish() } type Phone struct { } func ( phone Phone) work(){ 阅读全文

posted @ 2020-11-25 22:57 孤灯引路人 阅读(228) 评论(0) 推荐(0) 编辑

上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 23 下一页

导航