当前位置:首页>python>30天精通Python语法 | Day3:吃透字符串进阶操作,搞定Python文本处理全基础

30天精通Python语法 | Day3:吃透字符串进阶操作,搞定Python文本处理全基础

  • 2026-04-13 16:55:21
30天精通Python语法 | Day3:吃透字符串进阶操作,搞定Python文本处理全基础

本文为「30天吃透Python核心语法」系列第三篇,承接Day2的变量与数据类型内容,全程新手友好、无晦涩术语、纯文字讲解,每一个知识点都配可直接运行的代码示例,跟着练就能100%掌握日常90%的文本处理需求。

大家好,欢迎来到30天Python精通计划的第三天。

Day2我们一起搞定了变量与四大核心基础数据类型,其中字符串是Python里使用频率最高的类型,也是新手入门后最先能落地解决实际问题的工具。这段时间我收到了很多同学的留言:

- 我知道了什么是字符串,可怎么从身份证号里精准提取生日?

- 用户输入内容时不小心带了多余的空格,我该怎么自动清理?

- 怎么把一段话里的指定词语批量替换?

- 多个变量拼接成一句话,除了用加号还有更简单的方法吗?

别慌,这些问题的答案,全在今天的内容里。

字符串是Python办公自动化、数据分析、爬虫、文案批量处理的核心基础,今天我们把字符串的进阶操作拆解得明明白白,从精准提取内容,到批量修改文本,再到规范排版输出,一步不落。学完今天的内容,你将:

✅ 掌握字符串的索引与切片,精准提取文本里的任意内容

✅ 吃透字符串高频常用方法,覆盖替换、分割、去空格、格式转换全场景

✅ 学会3种字符串格式化方式,搞定数据排版输出,告别繁琐拼接

✅ 避开字符串操作的新手高频坑,解决90%的文本处理报错

✅ 能独立完成日常办公里绝大多数的基础文本处理需求

一、温故知新:字符串核心定义回顾

在开始进阶内容之前,我们先花1分钟回顾字符串的基础定义,帮大家把知识点衔接起来。

在Python里,所有用英文单引号、英文双引号、英文三引号包裹起来的内容,都是字符串,不管里面是文字、数字、符号,只要加了引号,就会被识别为字符串类型。

这里补充一个新手超实用的基础技巧:单双引号可以灵活混用。如果你的字符串内容里本身包含双引号,外面就用单引号包裹;内容里有单引号,外面就用双引号包裹,不用写复杂的转义字符,代码更简洁。

python  

# 单双引号混用示例,避免转义

print('我叫"张三",今年20岁,是"Python爱好者"')

print("我喜欢的格言是'人生在勤,不索何获'")

如果是多行的长文本,直接用三引号包裹,不用手动加换行符,和Day1里的多行打印用法一致。

二、字符串的索引与切片:精准提取文本内容

这是字符串操作最核心的基础,也是新手必须掌握的技能。我们日常提取文本里的指定内容,比如从身份证号里取生日、从手机号里取号段,全靠索引和切片实现。

1. 什么是索引?

用大白话讲,索引就是字符串里每个字符对应的「门牌号」,Python会给字符串里的每一个字符,都分配一个独一无二的编号,我们通过这个编号,就能精准取出对应的单个字符。

这里有一个新手必须刻在脑子里的规则:Python里的索引,是从0开始计数的,不是从1开始。

除了从左到右的正向索引,Python还支持从右到左的反向索引,反向索引从-1开始计数,最右侧的最后一个字符,编号就是-1,往左依次是-2、-3,以此类推。

举个例子,我们定义一个字符串 content = "Python学习" ,每个字符对应的索引如下:

- 正向索引:P对应0,y对应1,t对应2,h对应3,o对应4,n对应5,学对应6,习对应7

- 反向索引:习对应-1,学对应-2,n对应-3,o对应-4,h对应-5,t对应-6,y对应-7,P对应-8

我们可以直接通过索引,取出对应的单个字符,代码示例如下:

python  

content = "Python学习"

# 取正向索引0对应的第一个字符

print(content[0])

# 取反向索引-1对应的最后一个字符

print(content[-1])

# 取索引6对应的"学"字

print(content[6])

【新手避坑提示】单个字符的索引,绝对不能超出字符串的长度范围。比如上面的字符串一共8个字符,最大的正向索引是7,如果你写 content[8] ,程序会直接报错,这是新手第一天学索引100%会踩的坑。如果不确定字符串的长度,可以用 len() 函数先查看,比如 print(len(content)) ,就能得到字符串的总字符数。

2. 什么是切片?

切片就是通过索引范围,一次性取出字符串里的一段内容,而不是单个字符,这是我们日常文本处理中最常用的操作。

切片的核心语法是: 字符串[起始索引:结束索引:步长] 

接下来我们把每个部分的规则,用大白话讲清楚,每个规则都配可直接运行的示例。

第一个核心规则:左闭右开。

意思是,切片会包含起始索引对应的字符,但不会包含结束索引对应的字符,只会取到结束索引的前一个字符。比如我们要取"Python"这6个字母,就要写 content[0:6] ,结束索引写6,只会取到0-5的字符,正好是完整的"Python"。

第二个核心规则:缺省默认值。

如果不写起始索引,默认从字符串的第一个字符开始;如果不写结束索引,默认取到字符串的最后一个字符;如果前后都不写,只写一个冒号,就会取整个字符串。

第三个核心规则:步长控制。

步长就是每次取字符时,向前跳几个位置,默认步长是1,也就是一个挨着一个连续取。步长设为2,就是隔一个字符取一个;步长设为负数,就是从右往左倒着取,最常用的就是步长-1,可以直接实现字符串反转。

下面是完整的切片实操示例,大家可以直接复制到PyCharm里运行,看每一行的输出结果:

python  

content = "30天Python精通计划"

# 取前3个字符:30天

print(content[:3])

# 取第4到第9个字符:Python

print(content[3:9])

# 隔一个字符取一个

print(content[::2])

# 反转整个字符串

print(content[::-1])

# 从第2个字符开始,取到倒数第2个字符

print(content[1:-1])

【新手避坑提示】切片和单个索引不一样,就算结束索引超出了字符串的最大长度,程序也不会报错,会自动取到字符串的结尾,新手可以放心使用。

三、字符串高频常用方法:搞定文本处理全场景

Python给字符串内置了很多现成的处理方法,不用我们自己写复杂逻辑,直接调用就能实现文本的修改、清理、统计、判断等操作,下面我们把新手日常90%场景都会用到的方法,逐个拆解清楚,每个方法都讲清作用、用法和实际使用场景。

1. replace():批量替换文本内容

这个方法的核心作用,是把字符串里的指定内容,替换成你想要的新内容,日常办公里的批量修改文案、替换敏感词、统一文本格式,全靠它。

它的完整用法是: 字符串.replace(要替换的旧内容, 替换后的新内容, 替换次数) ,其中替换次数是可选的,不写的话,默认替换字符串里所有匹配到的内容。

代码示例:

python  

text = "我喜欢学Python,Python真的很简单,Python对新手超友好"

# 把所有的Python替换成"编程"

new_text = text.replace("Python", "编程")

print(new_text)

# 只替换前2个Python

new_text2 = text.replace("Python", "编程", 2)

print(new_text2)

2. strip():清理字符串首尾的空白字符

这个方法的核心作用,是去掉字符串开头和结尾的空格、换行符、制表符,新手最常用的场景,就是清理用户输入的内容——比如用户输入姓名、手机号时,不小心在前后多打了空格,用这个方法就能一键清理干净。

除此之外,还有两个衍生方法: lstrip() 只清理字符串开头的空白, rstrip() 只清理字符串结尾的空白,大家可以按需使用。

代码示例:

python  

user_input = "   张三  13800138000   \n"

# 去掉首尾所有空白字符

clean_input = user_input.strip()

print(clean_input)

# 只去掉开头的空白

left_clean = user_input.lstrip()

print(left_clean)

3. split():把字符串按指定分隔符拆分

这个方法的核心作用,是把一长串字符串,按你指定的分隔符切开,拆成多个独立的小片段,存放在列表里。比如处理用逗号、空格分隔的用户信息、表格数据,用这个方法一键就能拆分。

它的完整用法是: 字符串.split(分隔符, 分割次数) ,分割次数是可选的,不写的话,默认拆分所有匹配到的分隔符。

代码示例:

python  

info = "张三,20岁,北京市,Python爱好者"

# 按逗号拆分,得到一个包含4个元素的列表

info_list = info.split(",")

print(info_list)

# 只拆分第一个逗号,拆成2段

info_list2 = info.split(",", 1)

print(info_list2)

4. join():把多个字符串拼接成完整内容

这个方法和split()正好相反,核心作用是把列表里的多个字符串,用你指定的分隔符,拼接成一整串完整的文本,日常批量生成文案、拼接多行内容超级好用。

它的用法是: 分隔符.join(要拼接的字符串列表) 

代码示例:

python  

info_list = ["李四", "22岁", "上海市", "Java爱好者"]

# 用逗号把列表里的内容拼接成一整串

info = ",".join(info_list)

print(info)

# 用换行符拼接,让每个内容单独占一行

info_line = "\n".join(info_list)

print(info_line)

5. upper()与lower():英文字母大小写转换

这两个方法的作用很简单, upper() 会把字符串里所有的英文字母转成全大写, lower() 会转成全小写,最常用的场景是处理用户输入的验证码、英文关键词,实现不区分大小写的校验和匹配。

代码示例:

python  

code = "Python123"

# 转全大写

print(code.upper())

# 转全小写

print(code.lower())

6. startswith()与endswith():判断字符串的开头和结尾

这两个方法的核心作用,是判断字符串是不是以你指定的内容开头/结尾,返回的结果是布尔值True或False,后续我们学条件判断的时候,会高频用到。

最常用的场景是判断文件类型、校验手机号/身份证号的号段、筛选指定格式的文本。

代码示例:

python  

file_name = "Python学习笔记.pdf"

phone = "13800138000"

# 判断文件是不是pdf格式

print(file_name.endswith(".pdf"))

# 判断手机号是不是以138开头

print(phone.startswith("138"))

7. count():统计指定内容出现的次数

这个方法的核心作用,是统计字符串里,你指定的内容一共出现了多少次,返回的结果是一个整数,日常做简单的文本分析、关键词统计非常好用。

代码示例:

python  

text = "Python很简单,Python很强大,学Python就用30天精通计划"

# 统计"Python"出现的次数

count = text.count("Python")

print(f"Python一共出现了{count}次")

【新手必看避坑提示】上面所有的字符串方法,都不会修改原来的字符串。因为Python里的字符串是不可变类型,所有的修改操作,都会返回一个全新的字符串,你必须用一个新的变量去接收这个结果,不然修改是不会生效的。

这里给大家看错误示例和正确示例,避免踩坑:

python  

# 错误示例:没有用变量接收,修改不生效

text = "  张三  "

text.strip()

print(text)  # 输出结果还是带空格的"  张三  "

# 正确示例:用变量接收修改后的结果

text = "  张三  "

clean_text = text.strip()

print(clean_text)  # 输出结果是没有空格的"张三"

四、字符串格式化:搞定数据排版输出

Day2我们学过用加号拼接字符串,但这种方法有很多局限:多个变量拼接时代码会很繁琐,数字和字符串不能直接拼接,还要手动做类型转换。而字符串格式化,就是专门解决这个问题的,能让我们用最简洁的代码,把多个变量、数据排版成规范的文本。

新手只需要掌握下面3种格式化方式,从基础到进阶,我会给大家讲清每种方式的用法和优缺点,最后给大家推荐最优解。

1. 最基础:%s占位符格式化

这是Python最经典的格式化方式,简单好记,用特殊的占位符在字符串里占好位置,再在后面按顺序填入对应的变量。

最常用的占位符有3个: %s 代表字符串占位, %d 代表整数占位, %f 代表浮点数占位,其中 %s 是万能占位符,能兼容所有类型的数据。

代码示例:

python  

name = "王五"

age = 23

city = "广州市"

# 用%s占位,后面按顺序放入变量

info = "我叫%s,今年%d岁,来自%s" % (name, age, city)

print(info)

# 浮点数保留2位小数,用%.2f,会自动四舍五入

price = 9.986

print("商品价格是%.2f元" % price)

这种方式的优点是简单好记,兼容所有Python版本;缺点是变量多的时候,顺序很容易搞混,代码可读性很差,现在已经很少用了,大家了解即可。

2. 最通用:format()格式化

这是Python3官方推荐的格式化方式,用 {} 作为占位符,不用区分变量类型,还能给占位符起名、指定填充顺序,可读性比%占位符高很多,兼容性也很好。

代码示例:

python  

name = "赵六"

age = 21

city = "深圳市"

# 按顺序填充占位符

info = "我叫{},今年{}岁,来自{}".format(name, age, city)

print(info)

# 给占位符起名,不用在意变量的顺序

info2 = "我叫{user_name},今年{user_age}岁,来自{user_city}".format(user_city=city, user_name=name, user_age=age)

print(info2)

# 浮点数保留2位小数

price = 19.995

print("商品价格是{:.2f}元".format(price))

这种方式的优点是不用区分变量类型,支持自定义顺序,可读性高,功能更强大;缺点是变量多的时候,代码还是会有点冗长。

3. 最推荐:f-string格式化

这是现在Python行业里最常用、官方最推荐的格式化方式,也是对新手最友好的,语法超级简洁,可读性拉满,支持Python3.6及以上的版本,现在大家安装的Python版本都能满足要求,建议新手直接学这个,一步到位。

它的用法非常简单:在字符串的前面加一个小写的 f ,然后在字符串里用 {} 把变量名直接包起来就行,不仅能放变量,还能直接在括号里做算术运算、调用字符串方法,功能非常强大。

代码示例:

python  

name = "孙七"

age = 24

city = "杭州市"

# 直接把变量写在{}里

info = f"我叫{name},今年{age}岁,来自{city}"

print(info)

# 直接在{}里做算术运算

print(f"明年我就{age + 1}岁了")

# 浮点数保留2位小数

price = 29.987

print(f"商品价格是{price:.2f}元")

# 直接在{}里调用字符串方法

print(f"我的名字大写是{name.upper()}")

这种方式的优点是语法最简洁,可读性最高,不用手动做类型转换,支持直接写运算和方法调用,能覆盖所有格式化场景,现在所有的Python项目里,基本都用这种方式。

五、新手高频踩坑避坑指南

这里整理了Day3字符串操作里,新手100%会遇到的报错和问题,提前给大家讲清原因和解决方法,帮大家少走弯路。

1. 索引越界报错:IndexError: string index out of range

这个报错的核心原因,是你取单个字符的时候,写的索引超出了字符串的最大长度。解决方法:先用 len() 函数查看字符串的总长度,确保索引不超过「长度-1」,或者直接用反向索引,反向索引不容易出现越界问题。

2. 字符串修改后不生效

这个是新手最容易踩的坑,原因是Python的字符串是不可变类型,所有的修改方法都不会改动原字符串,只会返回新的字符串,你没有用变量接收,修改就不会生效。解决方法:每次调用字符串方法后,都用一个变量接收返回的结果,也可以直接覆盖原变量,比如 text = text.strip() 。

3. 字符串拼接报错:TypeError: can only concatenate str (not "int") to str

这个报错的原因,是你直接用加号把字符串和数字拼接在了一起。解决方法:要么用 str() 把数字转成字符串再拼接,要么直接用f-string格式化,f-string会自动帮你转换类型,不用手动处理,一劳永逸。

4. 切片步长为0报错:ValueError: slice step cannot be zero

这个报错的原因,是你写切片语法的时候,把步长设成了0。步长为0相当于原地不动,没法取内容,Python不支持这种写法。解决方法:步长要么不写,默认是1,要么写正整数或者负整数,绝对不能写0。

5. 引号报错:SyntaxError: EOL while scanning string literal

这个报错的核心原因,是字符串的引号用了中文格式,或者前后引号不成对,前单后双、前双后单都会触发这个报错。解决方法:检查字符串的引号,全部换成英文格式,确保前后成对;如果字符串里本身有引号,就用另一种引号包裹,避免冲突。

6. 路径里的转义字符生效,内容不对

比如你写了一个文件路径 "D:\new\text.txt" ,运行后发现内容不对,甚至报错。原因是字符串里的 \n 是换行符, \t 是制表符,以 \ 开头的是转义字符,会被Python自动解析。解决方法:在字符串前面加一个小写的 r ,变成原始字符串,转义字符就不会生效了,比如 r"D:\new\text.txt" ,这个写法在写文件路径、正则表达式的时候超级常用。

六、今日课后作业(必做!只看不敲,永远学不会)

编程是一门实操技能,只有动手敲代码,才能真正把知识变成自己的。今天的作业循序渐进,全部完成,才算真正吃透Day3的内容。

1. 基础必做:定义一个字符串,内容是你的手机号,用索引取出手机号的前3位和后4位,分别打印出来;再用切片取出手机号中间的4位,打印出来。

2. 进阶练习:定义一个字符串,内容是 "  今天天气很好,适合学Python,Python很简单!  " ,先清理掉首尾的空格,然后把里面的"Python"全部替换成"编程",再统计"很"字出现的次数,最后把处理后的字符串用感叹号分割成列表,把每一步的结果都打印出来。

3. 挑战练习:定义3个变量,分别存储商品名称、单价、购买数量,计算出总价格,用f-string格式化输出成一句话:"您购买的【商品名称】,单价XX元,购买XX件,总价格XX元",其中价格部分保留2位小数;同时判断商品名称是不是以"Python"开头,把判断结果也打印出来。

4. 习惯养成:给每一行代码都加上清晰的单行注释,变量名用规范的蛇形命名法,做到见名知意。

七、明日预告

Day4我们将学习Python的算术运算符与赋值运算符,搞懂Python里的所有数学运算、复合赋值操作,学会用代码实现各种复杂计算,为后续的条件判断、循环语句打下核心基础,也是Python语法里必须掌握的基础内容。

结尾互动

今天的内容你都学会了吗?

完成作业的同学,可以在评论区扣个【打卡Day3】!

有任何报错、不懂的问题,都可以在评论区留言,我会一一解答。

关注我,跟着30天计划,从零开始,彻底精通Python核心语法,每天1.5小时,30天就能独立写Python脚本,搞定日常办公自动化!

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-04-15 01:38:40 HTTP/2.0 GET : https://f.mffb.com.cn/a/486256.html
  2. 运行时间 : 0.081879s [ 吞吐率:12.21req/s ] 内存消耗:4,611.06kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=844ca47920b327a2066697663c0d60e3
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000603s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000794s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000312s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000231s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000469s ]
  6. SELECT * FROM `set` [ RunTime:0.000211s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000505s ]
  8. SELECT * FROM `article` WHERE `id` = 486256 LIMIT 1 [ RunTime:0.000477s ]
  9. UPDATE `article` SET `lasttime` = 1776188320 WHERE `id` = 486256 [ RunTime:0.008459s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000273s ]
  11. SELECT * FROM `article` WHERE `id` < 486256 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000485s ]
  12. SELECT * FROM `article` WHERE `id` > 486256 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000358s ]
  13. SELECT * FROM `article` WHERE `id` < 486256 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.000688s ]
  14. SELECT * FROM `article` WHERE `id` < 486256 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.000812s ]
  15. SELECT * FROM `article` WHERE `id` < 486256 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.000903s ]
0.083454s