摘要: package main import "fmt" func main() { slice := []int{1, 2, 3, 4, 5} for k, v := range slice { if v == 4 { slice = append(slice[:k], slice[k+1:]...) 阅读全文
posted @ 2023-10-17 09:03 青烟绕指柔 阅读(4) 评论(0) 推荐(0) 编辑
摘要: package mainimport ( "encoding/json" "gorm.io/driver/mysql" "gorm.io/gorm" "net/http" "strconv")// 新闻结构体type News struct { Id int `json:"id"` Title st 阅读全文
posted @ 2023-09-28 11:14 青烟绕指柔 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 1.将结构体转换为JSON: package main import ( "encoding/json" "fmt" ) type Person struct { Name string Age int Email string } func main() { person := Person{Na 阅读全文
posted @ 2023-07-11 13:52 青烟绕指柔 阅读(333) 评论(0) 推荐(0) 编辑
摘要: $username = $_POST['username']; if(empty($username)){ echo "<script>alert('姓名不能为空');window.location.href='1.php';</script>"; die(); } if(!preg_match(' 阅读全文
posted @ 2022-04-08 11:59 青烟绕指柔 阅读(43) 评论(0) 推荐(0) 编辑
摘要: <?php //11>设置session,必须处于脚本最顶部 session_start(); $image = imagecreatetruecolor(100, 30); //1>设置验证码图片大小的函数 //5>设置验证码颜色 imagecolorallocate(int im, int re 阅读全文
posted @ 2021-10-29 14:08 青烟绕指柔 阅读(71) 评论(0) 推荐(0) 编辑
摘要: <?php/** * @Author: zwb * @Date: 2021-09-19 14:25:27 * @Last Modified by: zwb * @Last Modified time: 2021-09-19 15:23:19 */?><!DOCTYPE html><html><hea 阅读全文
posted @ 2021-10-23 09:17 青烟绕指柔 阅读(44) 评论(0) 推荐(0) 编辑
摘要: <?php $str = "我是王铁锤子"; $reg = '/^[\x{4e00}-\x{9fa5}]{5}$/u'; $res = preg_match($reg,$str); var_dump($res); ?> 阅读全文
posted @ 2021-10-19 23:13 青烟绕指柔 阅读(47) 评论(0) 推荐(0) 编辑
摘要: 1.建立数据表 admins 2.找到config下的auth.php 文件,加入如下代码 <?php return [ /* | | Authentication Defaults | | | This option controls the default authentication "gua 阅读全文
posted @ 2021-09-27 19:21 青烟绕指柔 阅读(1236) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <script src="js/vue.js"></script> <!-- 最新版本的 Bootstrap 核心 CSS 文件 --> <link rel="s 阅读全文
posted @ 2021-09-02 21:44 青烟绕指柔 阅读(54) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <script src="js/vue.js"></script> <!-- 最新版本的 Bootstrap 核心 CSS 文件 --> <link rel="s 阅读全文
posted @ 2021-09-01 00:36 青烟绕指柔 阅读(377) 评论(0) 推荐(0) 编辑