0

0

Golang初学者Web服务器项目实战

P粉602998670

P粉602998670

发布时间:2025-09-15 09:01:01

|

917人浏览过

|

来源于php中文网

原创

答案:初学者应从net/http标准库入手,因其能直面HTTP协议本质,掌握路由、中间件、数据持久化与模板渲染核心机制。

golang初学者web服务器项目实战

构建一个Golang Web服务器,对于初学者而言,最直接且富有成效的实践路径,便是从零开始搭建一个具备基本路由、数据处理和响应能力的HTTP服务。这个过程不仅能让你快速掌握Go语言在Web开发中的核心机制,更能深刻理解其简洁高效的设计哲学。

要着手一个Golang Web服务器项目,我们通常会从

net/http
标准库开始。这就像是拿到了一把瑞士军刀,虽然没有花哨的外部包装,但功能强大且可靠。一个最基础的Web服务器可以这样启动:

package main

import (
    "fmt"
    "log"
    "net/http"
)

// homeHandler 处理根路径的请求
func homeHandler(w http.ResponseWriter, r *http.Request) {
    fmt.Fprintf(w, "欢迎来到我的Golang Web服务器!你正在访问: %s\n", r.URL.Path)
}

// aboutHandler 处理 /about 路径的请求
func aboutHandler(w http.ResponseWriter, r *http.Request) {
    fmt.Fprintf(w, "这是一个关于页面的示例。\n")
}

func main() {
    // 注册根路径处理器
    http.HandleFunc("/", homeHandler)
    // 注册 /about 路径处理器
    http.HandleFunc("/about", aboutHandler)

    fmt.Println("服务器正在启动,监听在 :8080...")
    // 启动服务器,监听所有接口的 8080 端口
    // nil 表示使用默认的 ServeMux
    log.Fatal(http.ListenAndServe(":8080", nil))
}

这段代码展示了一个最基本的服务器骨架。

http.HandleFunc
负责将特定的URL路径映射到我们定义的处理函数上。当请求到来时,Go的运行时会调用相应的处理函数,我们可以在其中读取请求(
*http.Request
)并写入响应(
http.ResponseWriter
)。
http.ListenAndServe
则负责启动服务器并监听指定端口。我个人觉得,这种开箱即用的能力,是Go在Web开发领域吸引我的一个重要原因。它没有太多隐晦的配置,一切都显得那么直白。

Golang Web服务器项目,为什么推荐从标准库
net/http
入手?

在我看来,对于Golang Web开发的初学者,直接从标准库

net/http
入手,是理解Web服务核心机制最有效的方式。这不仅仅是因为它内置在Go语言中,无需引入第三方依赖,更因为它强制你直面HTTP协议的本质。你得自己处理路由、请求解析、响应构建,这听起来可能有点“原始”,但正是这种“原始”让你对请求-响应周期有了深刻的理解。

立即学习go语言免费学习笔记(深入)”;

很多时候,我们过于依赖框架提供的抽象,以至于忽略了底层是如何工作的。

net/http
则是一个很好的反例,它提供了足够的基础设施,但又不过度封装。比如,
http.Handler
接口的设计,简洁而强大,它定义了任何可以处理HTTP请求的对象都必须实现
ServeHTTP(ResponseWriter, *Request)
方法。这种设计模式使得Go的Web组件具有极高的可组合性。你可以用它来构建一个简单的文件服务器,也可以作为更复杂API服务的基石。我曾见过一些项目,即使使用了像Gin或Echo这样的框架,但核心的业务逻辑处理,依然离不开对
net/http
底层原理的深刻把握。所以,打好这个基础,远比盲目追求最新的框架更重要。它让你在遇到问题时,能更容易地定位并解决,而不是被框架的“魔法”所困扰。

如何处理Golang Web服务器中的路由和中间件?

在Golang Web服务器中处理路由,最基础的方式就是使用

http.HandleFunc
或者更灵活的
http.ServeMux
http.ServeMux
是一个HTTP请求多路复用器,它可以根据请求的URL路径将请求分发给不同的处理器

// 结合http.ServeMux进行路由管理
func main() {
    mux := http.NewServeMux() // 创建一个新的ServeMux实例
    mux.HandleFunc("/", homeHandler)
    mux.HandleFunc("/about", aboutHandler)
    mux.HandleFunc("/api/data", apiDataHandler) // 注册一个API数据处理器

    fmt.Println("服务器正在启动,监听在 :8080...")
    // 将自定义的mux作为处理器传入 ListenAndServe
    log.Fatal(http.ListenAndServe(":8080", mux))
}

// apiDataHandler 返回一个简单的JSON响应
func apiDataHandler(w http.ResponseWriter, r *http.Request) {
    w.Header().Set("Content-Type", "application/json") // 设置响应头
    fmt.Fprintf(w, `{"message": "这是API数据", "status": "success"}`)
}

http.ServeMux
允许你更清晰地组织路由规则,并且它也支持路径匹配。当你的路由变得复杂时,你可能会考虑引入第三方路由库,比如
gorilla/mux
chi
,它们提供了更强大的功能,如路径参数、子路由、方法限制等。

韩顺平PHP入门到精通全套笔记
韩顺平PHP入门到精通全套笔记

韩顺平,毕业于清华大学,国内著名的软件培训高级讲师,先后在新浪、点击科技、用友就职。 主持或参与《新浪邮件系统》、《橙红sns(社会化网络)网站》、《点击科技协同软件群组服务器端(Linux/solaris平台)》、《国家总参语音监控系统》、《英语学习机系统》、《用友erp(u8产品)系统》等项目。实战经验丰富,授课耐心细致,通俗易懂,勇于实践,勤于创新,授课风格贴近生活,授课语言生动风趣,多年

下载

至于中间件(Middleware),它是一种在请求到达最终处理器之前或之后执行逻辑的机制。在Go中,中间件通常通过高阶函数(Higher-Order Functions)实现,即一个函数接收一个

http.Handler
并返回一个新的
http.Handler

一个简单的日志中间件可能长这样:

// loggingMiddleware 是一个简单的日志中间件
func loggingMiddleware(next http.Handler) http.Handler {
    return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
        log.Printf("收到请求: %s %s", r.Method, r.URL.Path)
        next.ServeHTTP(w, r) // 调用下一个处理器
        log.Printf("请求处理完成: %s %s", r.Method, r.URL.Path)
    })
}

func main() {
    mux := http.NewServeMux()
    mux.HandleFunc("/", homeHandler)
    mux.HandleFunc("/about", aboutHandler)

    // 将中间件应用到mux上,形成处理器链
    wrappedMux := loggingMiddleware(mux)

    fmt.Println("服务器正在启动,监听在 :8080...")
    log.Fatal(http.ListenAndServe(":8080", wrappedMux))
}

通过这种方式,你可以链式地应用多个中间件,处理认证、日志、错误恢复、CORS等横切关注点。这种模式非常灵活,也体现了Go语言函数式编程的一些思想。我个人在项目中,会根据业务需求灵活选择是使用标准库的

http.ServeMux
还是更强大的第三方路由,但中间件的实现模式基本是通用的,这让我觉得Go的生态系统在Web开发方面相当成熟。

Golang Web项目如何实现数据的持久化和模板渲染?

在任何一个稍微复杂点的Web项目中,数据的持久化和前端内容的动态生成都是不可或缺的。对于Golang Web项目,我们有多种成熟的方案。

数据持久化: Go语言在数据库操作方面有着非常强大的标准库支持,主要是

database/sql
包。它提供了一个通用的接口,可以与各种关系型数据库(如MySQL, PostgreSQL, SQLite)和部分NoSQL数据库进行交互。以SQLite为例,因为它的轻量级和文件存储特性,非常适合初学者项目:

首先,你需要引入一个具体的数据库驱动,比如

github.com/mattn/go-sqlite3

package main

import (
    "database/sql"
    "log"
    _ "github.com/mattn/go-sqlite3" // 导入驱动,但不在代码中直接使用
)

// User 结构体定义了用户数据模型
type User struct {
    ID    int
    Name  string
    Email string
}

// initDB 初始化数据库连接并创建表
func initDB() *sql.DB {
    db, err := sql.Open("sqlite3", "./test.db") // 打开或创建数据库文件
    if err != nil {
        log.Fatal("无法打开数据库:", err)
    }

    // 创建表(如果不存在)
    sqlStmt := `
    CREATE TABLE IF NOT EXISTS users (
        id INTEGER PRIMARY KEY AUTOINCREMENT,
        name TEXT,
        email TEXT UNIQUE
    );`
    _, err = db.Exec(sqlStmt)
    if err != nil {
        log.Fatalf("无法创建表 %q: %s\n", err, sqlStmt)
        return nil
    }
    return db
}

// insertUser 插入新用户
func insertUser(db *sql.DB, name, email string) error {
    stmt, err := db.Prepare("INSERT INTO users(name, email) VALUES(?, ?)")
    if err != nil {
        return err
    }
    defer stmt.Close()

    _, err = stmt.Exec(name, email)
    return err
}

// getUsers 查询所有用户
func getUsers(db *sql.DB) ([]User, error) {
    rows, err := db.Query("SELECT id, name, email FROM users")
    if err != nil {
        return nil, err
    }
    defer rows.Close()

    var users []User
    for rows.Next() {
        var u User
        if err := rows.Scan(&u.ID, &u.Name, &u.Email); err != nil {
            return nil, err
        }
        users = append(users, u)
    }
    return users, nil
}

这只是一个简化的例子,实际项目中你可能还会用到ORM(如GORM, XORM)来简化数据库操作,但我个人觉得,先从

database/sql
开始,理解SQL语句的执行和结果集的处理,对于后续使用ORM会更有帮助。

模板渲染: 对于动态生成HTML页面,Go的标准库提供了

html/template
包。它不仅能渲染HTML,还能自动进行HTML转义,有效防止XSS攻击。

首先,你需要定义你的HTML模板文件,例如在

templates/index.html




    
    {{.Title}}</title</pre>					</div>
					<div class="artmoreart ">
													<div class="artdp artptit"><span></span>
								<p>相关文章</p>
							</div>
							<div class="artmores flexColumn">
																	<a class="artmrlis flexRow" href="/faq/1803982.html" title="Go语言中MySQL数据与结构体的映射及行绑定实战"><b></b>
										<p class="overflowclass">Go语言中MySQL数据与结构体的映射及行绑定实战</p>
									</a>
																	<a class="artmrlis flexRow" href="/faq/1803962.html" title="Go语言中将MySQL行数据映射到结构体:数据类型处理与扫描实践"><b></b>
										<p class="overflowclass">Go语言中将MySQL行数据映射到结构体:数据类型处理与扫描实践</p>
									</a>
																	<a class="artmrlis flexRow" href="/faq/1803942.html" title="Go语言MySQL数据类型映射与数据行绑定实践指南"><b></b>
										<p class="overflowclass">Go语言MySQL数据类型映射与数据行绑定实践指南</p>
									</a>
																	<a class="artmrlis flexRow" href="/faq/1803916.html" title="Go语言中MySQL数据类型与结构体映射及查询结果绑定实战教程"><b></b>
										<p class="overflowclass">Go语言中MySQL数据类型与结构体映射及查询结果绑定实战教程</p>
									</a>
																	<a class="artmrlis flexRow" href="/faq/1803895.html" title="Go语言中MySQL数据行到结构体的映射与数据类型处理实践"><b></b>
										<p class="overflowclass">Go语言中MySQL数据行到结构体的映射与数据类型处理实践</p>
									</a>
															</div>
													<div class="artmoretabs flexRow">
								<p>相关标签:</p>
								<div class="mtbs flexRow">
									<a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/zt/15713.html" target="_blank">mysql</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/zt/15763.html" target="_blank">html</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/zt/15802.html" target="_blank">js</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/zt/15813.html" target="_blank">前端</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/zt/15841.html" target="_blank">git</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/zt/15848.html" target="_blank">json</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/zt/15863.html" target="_blank">go</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/zt/15997.html" target="_blank">github</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/zt/16009.html" target="_blank">golang</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/zt/16030.html" target="_blank">处理器</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/zt/16043.html" target="_blank">go语言</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/zt/16186.html" target="_blank">app</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/zt/17539.html" target="_blank">ai</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/search?q=golang" target="_blank">golang</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/search?q=sql" target="_blank">sql</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/search?q=mysql" target="_blank">mysql</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/search?q=中间件" target="_blank">中间件</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/search?q=gin" target="_blank">gin</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/search?q=html" target="_blank">html</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/search?q=xss" target="_blank">xss</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/search?q=echo" target="_blank">echo</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/search?q=封装" target="_blank">封装</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/search?q=接口" target="_blank">接口</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/search?q=Go语言" target="_blank">Go语言</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/search?q=对象" target="_blank">对象</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/search?q=github" target="_blank">github</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/search?q=sqlite" target="_blank">sqlite</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/search?q=database" target="_blank">database</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/search?q=postgresql" target="_blank">postgresql</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/search?q=nosql" target="_blank">nosql</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/search?q=数据库" target="_blank">数据库</a> <a class="mtbsa flexRow" onclick="hits_log(2,'www',this);" href-data="/search?q=http" target="_blank">http</a>								</div>
							</div>
						
						<p class="statement">本站声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn</p>
						<div class="lastanext flexRow">
													<a class="lastart flexRow" href="/faq/1520176.html" title="Golang模板方法模式定义算法骨架"><span>上一篇:</span>Golang模板方法模式定义算法骨架</a>
													<a class="nextart flexRow" href="/faq/1520204.html" title="GolangWebSocket实时通信开发示例"><span>下一篇:</span>GolangWebSocket实时通信开发示例</a>
												</div>
					</div>

					<div class="artlef-down ">
													<div class="authormore ">
								<div class="rightdTitle flexRow">
									<div class="title-left flexRow"> <b></b>
										<p>作者最新文章</p>
									</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/1900828.html" title="css渐变背景hover切换生硬怎么办_结合伪元素与transition制造渐变过渡"><b></b>
												<p class="overflowclass">css渐变背景hover切换生硬怎么办_结合伪元素与transition制造渐变过渡</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2025-12-27 13:59</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/1900829.html" title="如何在新服务器恢复数据_mysql迁移恢复流程"><b></b>
												<p class="overflowclass">如何在新服务器恢复数据_mysql迁移恢复流程</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2025-12-27 13:59</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/1900838.html" title="抖音怎么使用AI特效 抖音AI特效功能使用与创意视频制作"><b></b>
												<p class="overflowclass">抖音怎么使用AI特效 抖音AI特效功能使用与创意视频制作</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2025-12-27 14:01</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/1900844.html" title="PDF如何将PDF转为RTF富文本格式_PDF兼容性转换教程"><b></b>
												<p class="overflowclass">PDF如何将PDF转为RTF富文本格式_PDF兼容性转换教程</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2025-12-27 14:03</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/1900854.html" title="百度地图怎么使用步行AR导航_百度地图开启实景指路模式"><b></b>
												<p class="overflowclass">百度地图怎么使用步行AR导航_百度地图开启实景指路模式</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2025-12-27 14:05</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/1900857.html" title="如何将PDF文件转为PPT_PDF转演示文稿格式不变方法"><b></b>
												<p class="overflowclass">如何将PDF文件转为PPT_PDF转演示文稿格式不变方法</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2025-12-27 14:06</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/1900867.html" title="如何升级mysql而不影响业务_平滑升级思路"><b></b>
												<p class="overflowclass">如何升级mysql而不影响业务_平滑升级思路</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2025-12-27 14:08</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/1900868.html" title="如何使用Golang内置函数_len、cap、append等示例"><b></b>
												<p class="overflowclass">如何使用Golang内置函数_len、cap、append等示例</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2025-12-27 14:08</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/1900872.html" title="如何升级mysql版本_mysql版本升级准备"><b></b>
												<p class="overflowclass">如何升级mysql版本_mysql版本升级准备</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2025-12-27 14:09</p>
											</div>
										</div>
								</div>
																	<div class="authlist flexColumn">
										<div class="autharts flexRow">
											<a class="autharta flexRow " href="/faq/1900873.html" title="如何在Golang中使用指针接收者_为结构体方法传递引用"><b></b>
												<p class="overflowclass">如何在Golang中使用指针接收者_为结构体方法传递引用</p>
											</a>
											<div class="authtime flexRow"><b></b>
												<p>2025-12-27 14:09</p>
											</div>
										</div>
								</div>
															</div>
						
						<div class="moreAi ">
							<div class="rightdTitle flexRow">
								<div class="title-left flexRow"> <b></b>
									<p>热门AI工具</p>
								</div>
								<a target="_blank" class="rititle-more flexRow" href="/ai" title="热门AI工具"><span>更多</span><b></b></a>
							</div>

							<div class="moreailist flexRow">
																	<div class="aidcons flexRow  check ">
										<a target="_blank" href="/ai/723" title="DeepSeek" class="aibtns flexRow">
											<img src="https://img.php.cn/upload/ai_manual/000/000/000/175679963982777.png?x-oss-process=image/resize,m_mfit,h_70,w_70,limit_0" alt="DeepSeek" class="aibtnimg"
												onerror="this.src='/static/lhimages/moren/morentu.png'">
											<div class="aibtn-right flexColumn">
												<p class="overflowclass abripone">DeepSeek</p>
												<p class="overflowclass abriptwo">幻方量化公司旗下的开源大模型平台</p>
																									<div class="aidconstab flexRow">
																												<p href="/ai/tag/code/large-model" title="AI大模型" class="aidcontbp flexRow flexcenter">AI大模型</p>
																													<p href="/ai/tag/code/open-plat" title="开放平台" class="aidcontbp flexRow flexcenter">开放平台</p>
																											</div>
																							</div>
										</a>
									</div>
																	<div class="aidcons flexRow  check ">
										<a target="_blank" href="/ai/726" title="豆包大模型" class="aibtns flexRow">
											<img src="https://img.php.cn/upload/ai_manual/000/000/000/175680204067325.png?x-oss-process=image/resize,m_mfit,h_70,w_70,limit_0" alt="豆包大模型" class="aibtnimg"
												onerror="this.src='/static/lhimages/moren/morentu.png'">
											<div class="aibtn-right flexColumn">
												<p class="overflowclass abripone">豆包大模型</p>
												<p class="overflowclass abriptwo">字节跳动自主研发的一系列大型语言模型</p>
																									<div class="aidconstab flexRow">
																												<p href="/ai/tag/code/large-model" title="AI大模型" class="aidcontbp flexRow flexcenter">AI大模型</p>
																											</div>
																							</div>
										</a>
									</div>
																	<div class="aidcons flexRow  check ">
										<a target="_blank" href="/ai/725" title="通义千问" class="aibtns flexRow">
											<img src="https://img.php.cn/upload/ai_manual/000/000/000/175679974228210.png?x-oss-process=image/resize,m_mfit,h_70,w_70,limit_0" alt="通义千问" class="aibtnimg"
												onerror="this.src='/static/lhimages/moren/morentu.png'">
											<div class="aibtn-right flexColumn">
												<p class="overflowclass abripone">通义千问</p>
												<p class="overflowclass abriptwo">阿里巴巴推出的全能AI助手</p>
																									<div class="aidconstab flexRow">
																												<p href="/ai/tag/code/large-model" title="AI大模型" class="aidcontbp flexRow flexcenter">AI大模型</p>
																											</div>
																							</div>
										</a>
									</div>
																	<div class="aidcons flexRow  check ">
										<a target="_blank" href="/ai/854" title="腾讯元宝" class="aibtns flexRow">
											<img src="https://img.php.cn/upload/ai_manual/000/000/000/175679978251103.png?x-oss-process=image/resize,m_mfit,h_70,w_70,limit_0" alt="腾讯元宝" class="aibtnimg"
												onerror="this.src='/static/lhimages/moren/morentu.png'">
											<div class="aibtn-right flexColumn">
												<p class="overflowclass abripone">腾讯元宝</p>
												<p class="overflowclass abriptwo">腾讯混元平台推出的AI助手</p>
																									<div class="aidconstab flexRow">
																												<p href="/ai/tag/office/docs" title="文档处理" class="aidcontbp flexRow flexcenter">文档处理</p>
																													<p href="/ai/tag/office/excel" title="Excel 表格" class="aidcontbp flexRow flexcenter">Excel 表格</p>
																											</div>
																							</div>
										</a>
									</div>
																	<div class="aidcons flexRow  check ">
										<a target="_blank" href="/ai/724" title="文心一言" class="aibtns flexRow">
											<img src="https://img.php.cn/upload/ai_manual/000/000/000/175679974557049.png?x-oss-process=image/resize,m_mfit,h_70,w_70,limit_0" alt="文心一言" class="aibtnimg"
												onerror="this.src='/static/lhimages/moren/morentu.png'">
											<div class="aibtn-right flexColumn">
												<p class="overflowclass abripone">文心一言</p>
												<p class="overflowclass abriptwo">文心一言是百度开发的AI聊天机器人,通过对话可以生成各种形式的内容。</p>
																									<div class="aidconstab flexRow">
																												<p href="/ai/tag/code/large-model" title="AI大模型" class="aidcontbp flexRow flexcenter">AI大模型</p>
																													<p href="/ai/tag/text/chinese-writing" title="中文写作" class="aidcontbp flexRow flexcenter">中文写作</p>
																											</div>
																							</div>
										</a>
									</div>
																	<div class="aidcons flexRow  check ">
										<a target="_blank" href="/ai/1507" title="讯飞写作" class="aibtns flexRow">
											<img src="https://img.php.cn/upload/ai_manual/000/969/633/68b7a4153cd86671.png?x-oss-process=image/resize,m_mfit,h_70,w_70,limit_0" alt="讯飞写作" class="aibtnimg"
												onerror="this.src='/static/lhimages/moren/morentu.png'">
											<div class="aibtn-right flexColumn">
												<p class="overflowclass abripone">讯飞写作</p>
												<p class="overflowclass abriptwo">基于讯飞星火大模型的AI写作工具,可以快速生成新闻稿件、品宣文案、工作总结、心得体会等各种文文稿</p>
																									<div class="aidconstab flexRow">
																												<p href="/ai/tag/text/chinese-writing" title="中文写作" class="aidcontbp flexRow flexcenter">中文写作</p>
																													<p href="/ai/tag/text/write" title="写作工具" class="aidcontbp flexRow flexcenter">写作工具</p>
																											</div>
																							</div>
										</a>
									</div>
																	<div class="aidcons flexRow  check ">
										<a target="_blank" href="/ai/1115" title="即梦AI" class="aibtns flexRow">
											<img src="https://img.php.cn/upload/ai_manual/001/246/273/68b6d8f7c530c315.png?x-oss-process=image/resize,m_mfit,h_70,w_70,limit_0" alt="即梦AI" class="aibtnimg"
												onerror="this.src='/static/lhimages/moren/morentu.png'">
											<div class="aibtn-right flexColumn">
												<p class="overflowclass abripone">即梦AI</p>
												<p class="overflowclass abriptwo">一站式AI创作平台,免费AI图片和视频生成。</p>
																									<div class="aidconstab flexRow">
																												<p href="/ai/tag/image/image-titching" title="图片拼接" class="aidcontbp flexRow flexcenter">图片拼接</p>
																													<p href="/ai/tag/image/image-create" title="图画生成" class="aidcontbp flexRow flexcenter">图画生成</p>
																											</div>
																							</div>
										</a>
									</div>
																	<div class="aidcons flexRow  check ">
										<a target="_blank" href="/ai/808" title="ChatGPT" class="aibtns flexRow">
											<img src="https://img.php.cn/upload/ai_manual/000/000/000/175679970194596.png?x-oss-process=image/resize,m_mfit,h_70,w_70,limit_0" alt="ChatGPT" class="aibtnimg"
												onerror="this.src='/static/lhimages/moren/morentu.png'">
											<div class="aibtn-right flexColumn">
												<p class="overflowclass abripone">ChatGPT</p>
												<p class="overflowclass abriptwo">最最强大的AI聊天机器人程序,ChatGPT不单是聊天机器人,还能进行撰写邮件、视频脚本、文案、翻译、代码等任务。</p>
																									<div class="aidconstab flexRow">
																												<p href="/ai/tag/code/large-model" title="AI大模型" class="aidcontbp flexRow flexcenter">AI大模型</p>
																													<p href="/ai/tag/text/chinese-writing" title="中文写作" class="aidcontbp flexRow flexcenter">中文写作</p>
																											</div>
																							</div>
										</a>
									</div>
																	<div class="aidcons flexRow  check ">
										<a target="_blank" href="/ai/821" title="智谱清言 - 免费全能的AI助手" class="aibtns flexRow">
											<img src="https://img.php.cn/upload/ai_manual/000/000/000/175679976181507.png?x-oss-process=image/resize,m_mfit,h_70,w_70,limit_0" alt="智谱清言 - 免费全能的AI助手" class="aibtnimg"
												onerror="this.src='/static/lhimages/moren/morentu.png'">
											<div class="aibtn-right flexColumn">
												<p class="overflowclass abripone">智谱清言 - 免费全能的AI助手</p>
												<p class="overflowclass abriptwo">智谱清言 - 免费全能的AI助手</p>
																									<div class="aidconstab flexRow">
																												<p href="/ai/tag/code/large-model" title="AI大模型" class="aidcontbp flexRow flexcenter">AI大模型</p>
																													<p href="/ai/tag/office/pdf" title="PDF 文档" class="aidcontbp flexRow flexcenter">PDF 文档</p>
																											</div>
																							</div>
										</a>
									</div>
															</div>




						</div>

					</div>


				</div>


			</div>
			<div class="conRight artdtilRight ">
				<div class="artrig-adv ">
                    <script type="text/javascript" src="https://teacher.php.cn/php/MDM3MTk1MGYxYjI5ODJmNTE0ZWVkZTA3NmJhYzhmMjI6Og=="></script>
                </div>
				<div class="hotzt artdtzt">
					<div class="rightdTitle flexRow">
						<div class="title-left flexRow"> <b></b>
							<p>相关专题</p>
						</div>
						<a target="_blank" class="rititle-more flexRow" href="/faq/zt" title="相关专题"><span>更多</span><b></b></a>
					</div>
					<div class="hotztuls flexColumn">
													<div class="hotztlls flexRow">
								<a target="_blank" href="/faq/golangrhdybl" class="aClass flexRow hotzta" title="golang如何定义变量"><img
										src="https://img.php.cn/upload/subject/202401/27/2024012711462553414.jpg?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="golang如何定义变量" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/golangrhdybl" class="aClass flexRow hotztra overflowclass" title="golang如何定义变量">golang如何定义变量</a>
									<p class="aClass flexRow hotztrp overflowclass">golang定义变量的方法:1、声明变量并赋予初始值“var age int =值”;2、声明变量但不赋初始值“var age int”;3、使用短变量声明“age :=值”等等。本专题为大家提供相关的文章、下载、课程内容,供大家免费下载体验。</p>
									<div class="hotztrdown flexRow">
										<div class="htztdsee flexRow"> <b></b>
											<p class="">173</p>
										</div>
										<div class="htztdTime flexRow"> <b></b>
											<p>2024.02.23</p>
										</div>
									</div>
								</div>
							</div>
													<div class="hotztlls flexRow">
								<a target="_blank" href="/faq/golangynxsjzh" class="aClass flexRow hotzta" title="golang有哪些数据转换方法"><img
										src="https://img.php.cn/upload/subject/202401/27/2024012711552254696.jpg?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="golang有哪些数据转换方法" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/golangynxsjzh" class="aClass flexRow hotztra overflowclass" title="golang有哪些数据转换方法">golang有哪些数据转换方法</a>
									<p class="aClass flexRow hotztrp overflowclass">golang数据转换方法:1、类型转换操作符;2、类型断言;3、字符串和数字之间的转换;4、JSON序列化和反序列化;5、使用标准库进行数据转换;6、使用第三方库进行数据转换;7、自定义数据转换函数。本专题为大家提供相关的文章、下载、课程内容,供大家免费下载体验。</p>
									<div class="hotztrdown flexRow">
										<div class="htztdsee flexRow"> <b></b>
											<p class="">224</p>
										</div>
										<div class="htztdTime flexRow"> <b></b>
											<p>2024.02.23</p>
										</div>
									</div>
								</div>
							</div>
													<div class="hotztlls flexRow">
								<a target="_blank" href="/faq/golangcykynx" class="aClass flexRow hotzta" title="golang常用库有哪些"><img
										src="https://img.php.cn/upload/subject/202402/06/2024020614491669087.jpg?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="golang常用库有哪些" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/golangcykynx" class="aClass flexRow hotztra overflowclass" title="golang常用库有哪些">golang常用库有哪些</a>
									<p class="aClass flexRow hotztrp overflowclass">golang常用库有:1、标准库;2、字符串处理库;3、网络库;4、加密库;5、压缩库;6、xml和json解析库;7、日期和时间库;8、数据库操作库;9、文件操作库;10、图像处理库。本专题为大家提供相关的文章、下载、课程内容,供大家免费下载体验。</p>
									<div class="hotztrdown flexRow">
										<div class="htztdsee flexRow"> <b></b>
											<p class="">335</p>
										</div>
										<div class="htztdTime flexRow"> <b></b>
											<p>2024.02.23</p>
										</div>
									</div>
								</div>
							</div>
													<div class="hotztlls flexRow">
								<a target="_blank" href="/faq/golanggolangd" class="aClass flexRow hotzta" title="golang和python的区别是什么"><img
										src="https://img.php.cn/upload/subject/202403/05/2024030517354684603.jpg?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="golang和python的区别是什么" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/golanggolangd" class="aClass flexRow hotztra overflowclass" title="golang和python的区别是什么">golang和python的区别是什么</a>
									<p class="aClass flexRow hotztrp overflowclass">golang和python的区别是:1、golang是一种编译型语言,而python是一种解释型语言;2、golang天生支持并发编程,而python对并发与并行的支持相对较弱等等。本专题为大家提供相关的文章、下载、课程内容,供大家免费下载体验。</p>
									<div class="hotztrdown flexRow">
										<div class="htztdsee flexRow"> <b></b>
											<p class="">206</p>
										</div>
										<div class="htztdTime flexRow"> <b></b>
											<p>2024.03.05</p>
										</div>
									</div>
								</div>
							</div>
													<div class="hotztlls flexRow">
								<a target="_blank" href="/faq/golangsmfdm" class="aClass flexRow hotzta" title="golang是免费的吗"><img
										src="https://img.php.cn/upload/subject/202405/21/2024052115135391298.jpg?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="golang是免费的吗" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/golangsmfdm" class="aClass flexRow hotztra overflowclass" title="golang是免费的吗">golang是免费的吗</a>
									<p class="aClass flexRow hotztrp overflowclass">golang是免费的。golang是google开发的一种静态强类型、编译型、并发型,并具有垃圾回收功能的开源编程语言,采用bsd开源协议。本专题为大家提供相关的文章、下载、课程内容,供大家免费下载体验。</p>
									<div class="hotztrdown flexRow">
										<div class="htztdsee flexRow"> <b></b>
											<p class="">388</p>
										</div>
										<div class="htztdTime flexRow"> <b></b>
											<p>2024.05.21</p>
										</div>
									</div>
								</div>
							</div>
													<div class="hotztlls flexRow">
								<a target="_blank" href="/faq/golangjgtdq" class="aClass flexRow hotzta" title="golang结构体相关大全"><img
										src="https://img.php.cn/upload/subject/202506/09/2025060915221559704.jpg?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="golang结构体相关大全" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/golangjgtdq" class="aClass flexRow hotztra overflowclass" title="golang结构体相关大全">golang结构体相关大全</a>
									<p class="aClass flexRow hotztrp overflowclass">本专题整合了golang结构体相关大全,想了解更多内容,请阅读专题下面的文章。</p>
									<div class="hotztrdown flexRow">
										<div class="htztdsee flexRow"> <b></b>
											<p class="">193</p>
										</div>
										<div class="htztdTime flexRow"> <b></b>
											<p>2025.06.09</p>
										</div>
									</div>
								</div>
							</div>
													<div class="hotztlls flexRow">
								<a target="_blank" href="/faq/golangpdffdq" class="aClass flexRow hotzta" title="golang相关判断方法"><img
										src="https://img.php.cn/upload/subject/202506/10/2025061017002841902.jpg?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="golang相关判断方法" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/golangpdffdq" class="aClass flexRow hotztra overflowclass" title="golang相关判断方法">golang相关判断方法</a>
									<p class="aClass flexRow hotztrp overflowclass">本专题整合了golang相关判断方法,想了解更详细的相关内容,请阅读下面的文章。</p>
									<div class="hotztrdown flexRow">
										<div class="htztdsee flexRow"> <b></b>
											<p class="">184</p>
										</div>
										<div class="htztdTime flexRow"> <b></b>
											<p>2025.06.10</p>
										</div>
									</div>
								</div>
							</div>
													<div class="hotztlls flexRow">
								<a target="_blank" href="/faq/golangszsyff" class="aClass flexRow hotzta" title="golang数组使用方法"><img
										src="https://img.php.cn/upload/subject/202506/17/2025061715093054115.jpg?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="golang数组使用方法" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/golangszsyff" class="aClass flexRow hotztra overflowclass" title="golang数组使用方法">golang数组使用方法</a>
									<p class="aClass flexRow hotztrp overflowclass">本专题整合了golang数组用法,想了解更多的相关内容,请阅读专题下面的文章。</p>
									<div class="hotztrdown flexRow">
										<div class="htztdsee flexRow"> <b></b>
											<p class="">191</p>
										</div>
										<div class="htztdTime flexRow"> <b></b>
											<p>2025.06.17</p>
										</div>
									</div>
								</div>
							</div>
													<div class="hotztlls flexRow">
								<a target="_blank" href="/faq/ipdzxgjcdq" class="aClass flexRow hotzta" title="ip地址修改教程大全"><img
										src="https://img.php.cn/upload/subject/202512/26/2025122617594442052.jpg?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="ip地址修改教程大全" class="hotztaimg"
										onerror="this.src='/static/lhimages/moren/morentu.png'"></a>
								<div class="hotztright flexColumn">
									<a target="_blank" href="/faq/ipdzxgjcdq" class="aClass flexRow hotztra overflowclass" title="ip地址修改教程大全">ip地址修改教程大全</a>
									<p class="aClass flexRow hotztrp overflowclass">本专题整合了ip地址修改教程大全,阅读下面的文章自行寻找合适的解决教程。</p>
									<div class="hotztrdown flexRow">
										<div class="htztdsee flexRow"> <b></b>
											<p class="">27</p>
										</div>
										<div class="htztdTime flexRow"> <b></b>
											<p>2025.12.26</p>
										</div>
									</div>
								</div>
							</div>
											</div>
				</div>

				<div class="hotdownload ">
					<div class="rightdTitle flexRow">
						<div class="title-left flexRow"> <b></b>
							<p>热门下载</p>
						</div>
						<a target="_blank" class="rititle-more flexRow" href="/xiazai" title="热门下载"><span>更多</span><b></b></a>
					</div>
					<div class="hotdownTab">
						<div class="hdTabs flexRow">
							<div class="check" data-id="onef">网站特效 <b></b> </div> /
							<div class="" data-id="twof">网站源码 <b></b></div> /
							<div class="" data-id="threef">网站素材 <b></b></div> /
							<div class="" data-id="fourf">前端模板 <b></b></div>
						</div>
						<ul class="onef">
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="产品展示Smooth Products插件" href="/xiazai/js/8140"><span>[表单按钮]</span><span>产品展示Smooth Products插件</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="彩虹色文本描边动画网页特效" href="/xiazai/js/8139"><span>[文字特效]</span><span>彩虹色文本描边动画网页特效</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="jQuery自动播放的照片墙特效" href="/xiazai/js/8138"><span>[图片特效]</span><span>jQuery自动播放的照片墙特效</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="CSS3登录注册表单滑动切换特效" href="/xiazai/js/8137"><span>[表单按钮]</span><span>CSS3登录注册表单滑动切换特效</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="Form表单模拟美化插件" href="/xiazai/js/8136"><span>[表单按钮]</span><span>Form表单模拟美化插件</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="文字切换插件Adjector.js" href="/xiazai/js/8135"><span>[文字特效]</span><span>文字切换插件Adjector.js</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="简单实用的JS仿支付宝下拉菜单代码" href="/xiazai/js/8134"><span>[菜单导航]</span><span>简单实用的JS仿支付宝下拉菜单代码</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="jQuery图片位置随机显示代码" href="/xiazai/js/8133"><span>[图片特效]</span><span>jQuery图片位置随机显示代码</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="jQuery随机选择音乐试题代码" href="/xiazai/js/8132"><span>[表单按钮]</span><span>jQuery随机选择音乐试题代码</span></a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" title="jQuery字体变形插件Circletype" href="/xiazai/js/8131"><span>[文字特效]</span><span>jQuery字体变形插件Circletype</span></a>
									</div>
								</li>
													</ul>
						<ul class="twof" style="display:none;">
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/11353" title="雅龙智能装备工业设备类WordPress主题1.0"><span>[企业站源码]</span><span>雅龙智能装备工业设备类WordPress主题1.0</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/11352" title="威发卡自动发卡系统"><span>[电商源码]</span><span>威发卡自动发卡系统</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/11351" title="卡密分发系统"><span>[电商源码]</span><span>卡密分发系统</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/11350" title="中华陶瓷网"><span>[电商源码]</span><span>中华陶瓷网</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/11349" title="简洁粉色食品公司网站"><span>[电商源码]</span><span>简洁粉色食品公司网站</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/11348" title="极速网店系统"><span>[电商源码]</span><span>极速网店系统</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/11347" title="淘宝妈妈_淘客推广系统"><span>[电商源码]</span><span>淘宝妈妈_淘客推广系统</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/11346" title="积客B2SCMS商城系统"><span>[电商源码]</span><span>积客B2SCMS商城系统</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/11345" title="CODEC2I 众筹系统"><span>[电商源码]</span><span>CODEC2I 众筹系统</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/11344" title="ieshop超级网店系统"><span>[电商源码]</span><span>ieshop超级网店系统</span> </a>
									</div>
								</li>
													</ul>
						<ul class="threef" style="display:none;">
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4136" title="2026新年创意剪影海报矢量素材"><span>[网站素材]</span><span>2026新年创意剪影海报矢量素材</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4135" title="极简线条女子美容护肤矢量素材"><span>[网站素材]</span><span>极简线条女子美容护肤矢量素材</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4134" title="2026年日历表设计源文件下载"><span>[网站素材]</span><span>2026年日历表设计源文件下载</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4133" title="欧式复古西餐厅菜单设计矢量"><span>[网站素材]</span><span>欧式复古西餐厅菜单设计矢量</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4132" title="绘画艺术活动折扣票券设计下载"><span>[网站素材]</span><span>绘画艺术活动折扣票券设计下载</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4131" title="国潮复古肌理灯笼矢量素材"><span>[网站素材]</span><span>国潮复古肌理灯笼矢量素材</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4130" title="手绘户外山林露营海报矢量模板"><span>[网站素材]</span><span>手绘户外山林露营海报矢量模板</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4129" title="2026新年快乐艺术字PSD分层素材下载"><span>[网站素材]</span><span>2026新年快乐艺术字PSD分层素材下载</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4128" title="复古假日鸡尾酒菜单矢量模板"><span>[网站素材]</span><span>复古假日鸡尾酒菜单矢量模板</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/sucai/4127" title="时尚耳饰宣传海报PSD素材下载"><span>[网站素材]</span><span>时尚耳饰宣传海报PSD素材下载</span> </a>
									</div>
								</li>
													</ul>
						<ul class="fourf" style="display:none;">
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/8590"  title="驾照考试驾校HTML5网站模板"><span>[前端模板]</span><span>驾照考试驾校HTML5网站模板</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/8589"  title="驾照培训服务机构宣传网站模板"><span>[前端模板]</span><span>驾照培训服务机构宣传网站模板</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/8588"  title="HTML5房地产公司宣传网站模板"><span>[前端模板]</span><span>HTML5房地产公司宣传网站模板</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/8587"  title="新鲜有机肉类宣传网站模板"><span>[前端模板]</span><span>新鲜有机肉类宣传网站模板</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/8586"  title="响应式天气预报宣传网站模板"><span>[前端模板]</span><span>响应式天气预报宣传网站模板</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/8585"  title="房屋建筑维修公司网站CSS模板"><span>[前端模板]</span><span>房屋建筑维修公司网站CSS模板</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/8584"  title="响应式志愿者服务网站模板"><span>[前端模板]</span><span>响应式志愿者服务网站模板</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/8583"  title="创意T恤打印店网站HTML5模板"><span>[前端模板]</span><span>创意T恤打印店网站HTML5模板</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/8582"  title="网页开发岗位简历作品展示网页模板"><span>[前端模板]</span><span>网页开发岗位简历作品展示网页模板</span> </a>
									</div>
								</li>
															<li>
									<div class="wzrfourli flexRow">
										<b></b>
										<a target="_blank" href="/xiazai/code/8581"  title="响应式人力资源机构宣传网站模板"><span>[前端模板]</span><span>响应式人力资源机构宣传网站模板</span> </a>
									</div>
								</li>
													</ul>
					</div>
					<script>
						$('.hdTabs>div').click(function (e) {
							$('.hdTabs>div').removeClass('check')
							$(this).addClass('check')
							$('.hotdownTab>ul').css('display', 'none')
							$('.' + e.currentTarget.dataset.id).show()
						})
					</script>

				</div>

				<div class="artrig-adv ">
					<script type="text/javascript" src="https://teacher.php.cn/php/MDM3MTk1MGYxYjI5ODJmNTE0ZWVkZTA3NmJhYzhmMjI6Og=="></script>
                </div>



				<div class="xgarts ">
					<div class="rightdTitle flexRow">
						<div class="title-left flexRow"> <b></b>
							<p>相关下载</p>
						</div>
						<a target="_blank" class="rititle-more flexRow" href="/xiazai" title="相关下载"><span>更多</span><b></b></a>
					</div>
					<div class="xgwzlist ">
											<div class="xgwzlid flexRow"><b></b><a target="_blank" title="韩顺平PHP入门到精通全套笔记" href="/xiazai/learn/2666">韩顺平PHP入门到精通全套笔记</a></div>
											<div class="xgwzlid flexRow"><b></b><a target="_blank" title="PHP Apache和MySQL 网页开发初步" href="/xiazai/learn/2619">PHP Apache和MySQL 网页开发初步</a></div>
											<div class="xgwzlid flexRow"><b></b><a target="_blank" title="PHP Apache 和 MySQL 网页开发初步" href="/xiazai/learn/2580">PHP Apache 和 MySQL 网页开发初步</a></div>
											<div class="xgwzlid flexRow"><b></b><a target="_blank" title="PHP 5 揭密" href="/xiazai/learn/2579">PHP 5 揭密</a></div>
										</div>

				</div>

				<div class="jpkc">
					<div class="rightdTitle flexRow">
						<div class="title-left flexRow"> <b></b>
							<p>精品课程</p>
						</div>
						<a class="rititle-more flexRow" target="_blank" href="/course/sort_new.html" title="精品课程"><span>更多</span><b></b></a>
					</div>
					<div class=" jpkcTab">
						<div class=" jpkcTabs flexRow">
							<div class="check" data-id="onefd">相关推荐 <b></b> </div> /
							<div class="" data-id="twofd">热门推荐 <b></b></div> /
							<div class="" data-id="threefd">最新课程 <b></b></div>
						</div>
						<div class="onefd jpktabd">
													<div  class="ristyA flexRow " >
								<a target="_blank" href="/course/1686.html" title="MySQL 教程">
									<img src="https://img.php.cn/upload/course/000/000/090/68a58ba6b8207458.png?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="MySQL 教程" class="ristyAimg"
										onerror="this.src='/static/mobimages/moren/morentu.png'">
								</a>
								<div class="ristyaRight flexColumn">
									<a target="_blank" href="/course/1686.html" title="MySQL 教程"
										class="rirightp overflowclass">MySQL 教程</a>

									<div class="risrdown flexRow">
										<p>共48课时 | 1.5万人学习</p>
									</div>
								</div>
							</div>
													<div  class="ristyA flexRow " >
								<a target="_blank" href="/course/1643.html" title="MySQL 初学入门(mosh老师)">
									<img src="https://img.php.cn/upload/course/000/000/067/66123f1bad93f980.png?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="MySQL 初学入门(mosh老师)" class="ristyAimg"
										onerror="this.src='/static/mobimages/moren/morentu.png'">
								</a>
								<div class="ristyaRight flexColumn">
									<a target="_blank" href="/course/1643.html" title="MySQL 初学入门(mosh老师)"
										class="rirightp overflowclass">MySQL 初学入门(mosh老师)</a>

									<div class="risrdown flexRow">
										<p>共3课时 | 0.3万人学习</p>
									</div>
								</div>
							</div>
													<div  class="ristyA flexRow " >
								<a target="_blank" href="/course/1628.html" title="简单聊聊mysql8与网络通信">
									<img src="https://img.php.cn/upload/course/000/000/067/658d0737eae46201.png?x-oss-process=image/resize,m_mfit,h_75,w_120,limit_0" alt="简单聊聊mysql8与网络通信" class="ristyAimg"
										onerror="this.src='/static/mobimages/moren/morentu.png'">
								</a>
								<div class="ristyaRight flexColumn">
									<a target="_blank" href="/course/1628.html" title="简单聊聊mysql8与网络通信"
										class="rirightp overflowclass">简单聊聊mysql8与网络通信</a>

									<div class="risrdown flexRow">
										<p>共1课时 | 774人学习</p>
									</div>
								</div>
							</div>
												</div>

						<div class="twofd jpktabd" style="display:none;">
															<div  class="ristyA flexRow " >
									<a target="_blank" href="/course/1656.html" title="JavaScript ES5基础线上课程教学">
										<img src="https://img.php.cn/upload/course/000/000/081/6862652adafef801.png?x-oss-process=image/resize,m_mfit,h_86,w_140,limit_0" alt="JavaScript ES5基础线上课程教学" class="ristyAimg"
											onerror="this.src='/static/mobimages/moren/morentu.png'">
									</a>
									<div class="ristyaRight flexColumn">
										<a target="_blank" href="/course/1656.html" title="JavaScript ES5基础线上课程教学"
											class="rirightp overflowclass">JavaScript ES5基础线上课程教学</a>

										<div class="risrdown flexRow">
											<p>共6课时 | 6.9万人学习</p>
										</div>
									</div>
								</div>
															<div  class="ristyA flexRow " >
									<a target="_blank" href="/course/812.html" title="最新ThinkPHP 5.1全球首发视频教程(60天成就PHP大牛线上培训班课)">
										<img src="https://img.php.cn/upload/course/000/000/041/620debc3eab3f377.jpg?x-oss-process=image/resize,m_mfit,h_86,w_140,limit_0" alt="最新ThinkPHP 5.1全球首发视频教程(60天成就PHP大牛线上培训班课)" class="ristyAimg"
											onerror="this.src='/static/mobimages/moren/morentu.png'">
									</a>
									<div class="ristyaRight flexColumn">
										<a target="_blank" href="/course/812.html" title="最新ThinkPHP 5.1全球首发视频教程(60天成就PHP大牛线上培训班课)"
											class="rirightp overflowclass">最新ThinkPHP 5.1全球首发视频教程(60天成就PHP大牛线上培训班课)</a>

										<div class="risrdown flexRow">
											<p>共79课时 | 150.5万人学习</p>
										</div>
									</div>
								</div>
															<div  class="ristyA flexRow " >
									<a target="_blank" href="/course/639.html" title="phpStudy极速入门视频教程">
										<img src="https://img.php.cn/upload/course/000/000/068/62611ef88fcec821.jpg?x-oss-process=image/resize,m_mfit,h_86,w_140,limit_0" alt="phpStudy极速入门视频教程" class="ristyAimg"
											onerror="this.src='/static/mobimages/moren/morentu.png'">
									</a>
									<div class="ristyaRight flexColumn">
										<a target="_blank" href="/course/639.html" title="phpStudy极速入门视频教程"
											class="rirightp overflowclass">phpStudy极速入门视频教程</a>

										<div class="risrdown flexRow">
											<p>共6课时 | 53.2万人学习</p>
										</div>
									</div>
								</div>
													</div>

						<div class="threefd jpktabd" style="display:none;">
															<div  class="ristyA flexRow " >
										<a target="_blank" href="/course/1696.html" title="最新Python教程 从入门到精通">
											<img src="https://img.php.cn/upload/course/000/000/081/68c135bb72783194.png?x-oss-process=image/resize,m_mfit,h_86,w_140,limit_0" alt="最新Python教程 从入门到精通" class="ristyAimg"
												onerror="this.src='/static/mobimages/moren/morentu.png'">
										</a>
										<div class="ristyaRight flexColumn">
											<a target="_blank" href="/course/1696.html" title="最新Python教程 从入门到精通"
												class="rirightp overflowclass">最新Python教程 从入门到精通</a>

											<div class="risrdown flexRow">
												<p>共4课时 | 0.6万人学习</p>
											</div>
										</div>
									</div>
																<div  class="ristyA flexRow " >
										<a target="_blank" href="/course/1656.html" title="JavaScript ES5基础线上课程教学">
											<img src="https://img.php.cn/upload/course/000/000/081/6862652adafef801.png?x-oss-process=image/resize,m_mfit,h_86,w_140,limit_0" alt="JavaScript ES5基础线上课程教学" class="ristyAimg"
												onerror="this.src='/static/mobimages/moren/morentu.png'">
										</a>
										<div class="ristyaRight flexColumn">
											<a target="_blank" href="/course/1656.html" title="JavaScript ES5基础线上课程教学"
												class="rirightp overflowclass">JavaScript ES5基础线上课程教学</a>

											<div class="risrdown flexRow">
												<p>共6课时 | 6.9万人学习</p>
											</div>
										</div>
									</div>
																<div  class="ristyA flexRow " >
										<a target="_blank" href="/course/1655.html" title="PHP新手语法线上课程教学">
											<img src="https://img.php.cn/upload/course/000/000/081/684a8c23d811b293.png?x-oss-process=image/resize,m_mfit,h_86,w_140,limit_0" alt="PHP新手语法线上课程教学" class="ristyAimg"
												onerror="this.src='/static/mobimages/moren/morentu.png'">
										</a>
										<div class="ristyaRight flexColumn">
											<a target="_blank" href="/course/1655.html" title="PHP新手语法线上课程教学"
												class="rirightp overflowclass">PHP新手语法线上课程教学</a>

											<div class="risrdown flexRow">
												<p>共13课时 | 0.8万人学习</p>
											</div>
										</div>
									</div>
														</div>
						<script>
							$('.jpkcTabs>div').click(function (e) {
								$('.jpkcTabs>div').removeClass('check')
								$(this).addClass('check')
								$('.jpkcTab .jpktabd').css('display', 'none')
								$('.' + e.currentTarget.dataset.id).show()
							})
						</script>

					</div>
				</div>

				<div class="zxarts ">
					<div class="rightdTitle flexRow">
						<div class="title-left flexRow"> <b></b>
							<p>最新文章</p>
						</div>
						<a class="rititle-more flexRow" href="" title="最新文章" target="_blank"><span>更多</span><b></b></a>
					</div>
					<div class="xgwzlist ">
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="如何在 Go 中遍历结构体时排除空字段" href="/faq/1902690.html">如何在 Go 中遍历结构体时排除空字段</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="如何在 Go 中实现 SoundCloud 流式音频播放" href="/faq/1902670.html">如何在 Go 中实现 SoundCloud 流式音频播放</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="Go 中 exec.Command 执行 awk 命令失败的常见原因与正确写法" href="/faq/1902669.html">Go 中 exec.Command 执行 awk 命令失败的常见原因与正确写法</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="如何在 Go 中遍历结构体时跳过空字段(nil 或零值)" href="/faq/1902650.html">如何在 Go 中遍历结构体时跳过空字段(nil 或零值)</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="如何在 Go 中实现 SoundCloud 音频流播放" href="/faq/1902577.html">如何在 Go 中实现 SoundCloud 音频流播放</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="如何在 Go 中正确使用 exec.Command 调用 awk 命令" href="/faq/1902554.html">如何在 Go 中正确使用 exec.Command 调用 awk 命令</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="并发读取文件并行处理:Go 语言 worker pool 实战教程" href="/faq/1902360.html">并发读取文件并行处理:Go 语言 worker pool 实战教程</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="如何在 Go 中实现文件读取与正则匹配的并发处理" href="/faq/1902322.html">如何在 Go 中实现文件读取与正则匹配的并发处理</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="并发读取文件并行处理:Go 语言中基于通道与工作池的正确实践" href="/faq/1902250.html">并发读取文件并行处理:Go 语言中基于通道与工作池的正确实践</a></div>
													<div class="xgwzlid flexRow"><b></b><a target="_blank" title="Go语言中 %g 格式化动词与 math.Nextafter 函数详解" href="/faq/1902223.html">Go语言中 %g 格式化动词与 math.Nextafter 函数详解</a></div>
											</div>

				</div>






			</div>



		</div>

	</div>
	<!--底部-->
	<div class="phpFoot">
    <div class="phpFootIn">
        <div class="phpFootCont">
            <div class="phpFootLeft">
                <dl>
                    <dt>
                        <a target="_blank"  href="/about/us.html" rel="nofollow"  title="关于我们" class="cBlack">关于我们</a>
                        <a target="_blank"  href="/about/disclaimer.html" rel="nofollow"  title="免责申明" class="cBlack">免责申明</a>
                        <a target="_blank"  href="/about/jbzx.html" rel="nofollow"  title="举报中心" class="cBlack">举报中心</a>
                        <a   href="javascript:;" rel="nofollow" onclick="advice_data(99999999,'意见反馈')"   title="意见反馈" class="cBlack">意见反馈</a>
                        <a target="_blank"  href="https://www.php.cn/teacher.html" rel="nofollow"   title="讲师合作" class="cBlack">讲师合作</a>
                        <a  target="_blank" href="https://www.php.cn/blog/detail/20304.html" rel="nofollow"  title="广告合作" class="cBlack">广告合作</a>
                        <a  target="_blank" href="/new/"    title="最新文章列表" class="cBlack">最新更新</a>
                                                <div class="clear"></div>
                    </dt>
                    <dd class="cont1">php中文网:公益在线php培训,帮助PHP学习者快速成长!</dd>
                    <dd class="cont2">
                      <span class="ylwTopBox">
                        <a   href="javascript:;"  class="cBlack"><b class="icon1"></b>关注服务号</a>
                        <em style="display:none;" class="ylwTopSub">
                          <p>微信扫码<br/>关注PHP中文网服务号</p>
                          <img src="/static/images/examples/text16.png"/>
                        </em>
                      </span>
                        <span class="ylwTopBox">
                        <a   href="tencent://message/?uin=27220243&Site=www.php.cn&Menu=yes"  class="cBlack"><b class="icon2"></b>技术交流群</a>
                        <em style="display:none;" class="ylwTopSub">
                          <p>QQ扫码<br/>加入技术交流群</p>
                          <img src="/static/images/examples/text18.png"/>
                        </em>
                      </span>
                        <div class="clear"></div>
                    </dd>
                </dl>
                
            </div>
            <div class="phpFootRight">
                <div class="phpFootMsg">
                    <span><img src="/static/images/examples/text17.png"/></span>
                    <dl>
                        <dt>PHP中文网订阅号</dt>
                        <dd>每天精选资源文章推送</dd>
                    </dl>
                </div>
            </div>
        </div>
    </div>
    <div class="phpFootCode">
        <div class="phpFootCodeIn"><p>Copyright 2014-2025 <a   href="https://www.php.cn/" >https://www.php.cn/</a> All Rights Reserved | php.cn | <a   href="https://beian.miit.gov.cn/" rel="nofollow" >湘ICP备2023035733号</a></p><a   href="http://www.beian.gov.cn/portal/index.do" rel="nofollow" ><b></b></a></div>
    </div>
</div>
<input type="hidden" id="verifycode" value="/captcha.html">
<script>
    var _hmt = _hmt || [];
    (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?c0e685c8743351838d2a7db1c49abd56";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>
<script>layui.use(['element', 'carousel'], function () {var element = layui.element;$ = layui.jquery;var carousel = layui.carousel;carousel.render({elem: '#test1', width: '100%', height: '330px', arrow: 'always'});$.getScript('/static/js/jquery.lazyload.min.js', function () {$("img").lazyload({placeholder: "/static/images/load.jpg", effect: "fadeIn", threshold: 200, skip_invisible: false});});});</script>

<span class="layui-hide"><script type="text/javascript" src="https://s4.cnzz.com/z_stat.php?id=1280886301&web_id=1280886301"></script></span>

<script src="/static/js/cdn.js?v=1.0.1"></script>



	<!--底部 end-->
	<!-- content -->
	<!--
    <div class="phpFudong">
        <div class="phpFudongIn">
            <div class="phpFudongImg"></div>
            <div class="phpFudongXue">登录PHP中文网,和优秀的人一起学习!</div>
            <div class="phpFudongQuan">全站<span>2000+</span>教程免费学</div>
            <div class="phpFudongCode"><a   href="javascript:;" id="login" title="微信扫码登录">微信扫码登录</a></div>
            <div class="phpGuanbi" onclick="$('.phpFudong').hide();"></div>
            <div class="clear"></div>
        </div>
    </div>
-->	<!--底部浮动层 end-->
	<!--侧导航-->
	<style>
    .layui-fixbar{display: none;}
</style>
<div class="phpSdhBox" style="height:240px !important;">
    <li>
        <div class="phpSdhIn">
            <div class="phpSdhTitle">
                <a   href="/k24.html"  class="hover" title="PHP学习">
                    <b class="icon1"></b>
                    <p>PHP学习</p>
                </a>
            </div>
        </div>
    </li>
    <li>
        <div class="phpSdhIn">
            <div class="phpSdhTitle">
                <a   href="https://www.php.cn/blog/detail/1047189.html" >
                    <b class="icon2"></b>
                    <p>技术支持</p>
                </a>
            </div>
        </div>
    </li>
    <li>
        <div class="phpSdhIn">
            <div class="phpSdhTitle">
                <a   href="#">
                    <b class="icon6"></b>
                    <p>返回顶部</p>
                </a>
            </div>
        </div>
    </li>
</div>
	</body>

</html>

<script type="text/javascript" src="/hitsUp?type=article&id=1520181&time=1766853377">
</script>
<script src="/static/ueditor/third-party/SyntaxHighlighter/shCore.js?1766853377"></script>
<script>
	article_status = "969633";
</script>
<input type="hidden" id="verifycode" value="/captcha.html">
<script type="text/javascript" src="/static/js/global.min.js?5.5.33"></script>
<link rel='stylesheet' id='_main-css' href='/static/css/viewer.min.css?2' type='text/css' media='all' />
<script type='text/javascript' src='/static/js/viewer.min.js?1'></script>
<script type='text/javascript' src='/static/js/jquery-viewer.min.js'></script>
<script type="text/javascript" src="/static/js/jquery.cookie.js"></script>
<script>var _hmt = _hmt || [];(function(){var hm = document.createElement("script");hm.src="//hm.baidu.com/hm.js?c0e685c8743351838d2a7db1c49abd56";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(hm, s);})();(function(){var bp = document.createElement('script');var curProtocol = window.location.protocol.split(':')[0];if(curProtocol === 'https'){bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';}else{bp.src = 'http://push.zhanzhang.baidu.com/push.js';};var s = document.getElementsByTagName("script")[0];s.parentNode.insertBefore(bp, s);})();</script>
	

<script>
	function setCookie(name, value, iDay) { //name相当于键,value相当于值,iDay为要设置的过期时间(天)
		var oDate = new Date();
		oDate.setDate(oDate.getDate() + iDay);
		document.cookie = name + '=' + value + ';path=/;domain=.php.cn;expires=' + oDate;
	}

	function getCookie(name) {
		var cookieArr = document.cookie.split(";");
		for (var i = 0; i < cookieArr.length; i++) {
			var cookiePair = cookieArr[i].split("=");
			if (name == cookiePair[0].trim()) {
				return decodeURIComponent(cookiePair[1]);
			}
		}
		return null;
	}
</script>


<!-- Matomo -->
<script>
	var _paq = window._paq = window._paq || [];
	/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
	_paq.push(['trackPageView']);
	_paq.push(['enableLinkTracking']);
	(function () {
		var u = "https://tongji.php.cn/";
		_paq.push(['setTrackerUrl', u + 'matomo.php']);
		_paq.push(['setSiteId', '11']);
		var d = document,
			g = d.createElement('script'),
			s = d.getElementsByTagName('script')[0];
		g.async = true;
		g.src = u + 'matomo.js';
		s.parentNode.insertBefore(g, s);
	})();
</script>
<!-- End Matomo Code -->

<script>
	setCookie('is_article', 1, 1);
</script>

<script>
	var is_login = "0";
        var show = 0;
        var ceng = getCookie('ceng');
        //未登录复制显示登录按钮
        if(is_login == 0 && false){
            $(".code").hover(function(){
                $(this).find('.contentsignin').show();
            },function(){
                $(this).find('.contentsignin').hide();
            });
            //不给复制
            $('.code').bind("cut copy paste",function(e) {
                e.preventDefault();
            });
            $('.code .contentsignin').click(function(){
                $(document).trigger("api.loginpopbox");
            })
        }else{
            // 获取所有的 <pre> 元素
            var preElements = document.querySelectorAll('pre');
            preElements.forEach(function(preElement) {
                // 创建复制按钮
                var copyButton = document.createElement('button');
                copyButton.className = 'copy-button';
                copyButton.textContent = '复制';
                // 添加点击事件处理程序
                copyButton.addEventListener('click', function() {
                    // 获取当前按钮所属的 <pre> 元素中的文本内容
                    var textContent = preElement.textContent.trim();
                    // 创建一个临时 textarea 元素并设置其值为 <pre> 中的文本内容
                    var tempTextarea = document.createElement('textarea');
                    tempTextarea.value = textContent;
                    // 将临时 textarea 添加到文档中
                    document.body.appendChild(tempTextarea);
                    // 选中临时 textarea 中的文本内容并执行复制操作
                    tempTextarea.select();
                    document.execCommand('copy');
                    // 移除临时 textarea 元素
                    document.body.removeChild(tempTextarea);
                    // 更新按钮文本为 "已复制"
                    this.textContent = '已复制';
                });

                // 创建AI写代码按钮
                var aiButton = document.createElement('button');
                aiButton.className = 'copy-button';
                aiButton.textContent = 'AI写代码';
                aiButton.style.marginLeft = '5px';
                aiButton.style.marginRight = '5px';
                // 添加点击事件处理程序
                aiButton.addEventListener('click', function() {
                // Generate a random number between 0 and 1
                        var randomChance = Math.random();

                    // If the random number is less than 0.5, open the first URL, else open the second
                    if (randomChance < 0.5) {
                        window.open('https://www.doubao.com/chat/coding?channel=php&source=hw_db_php', '_blank');
                    } else {
                        window.open('https://click.aliyun.com/m/1000402709/', '_blank');
                    }
                });

                // 将按钮添加到 <pre> 元素前面
                preElement.parentNode.insertBefore(copyButton, preElement);
                preElement.parentNode.insertBefore(aiButton, preElement);
        });
        }
</script>