当前位置:首页>python>【一起学Python】第12天:字符串类型String详细使用总结

【一起学Python】第12天:字符串类型String详细使用总结

  • 2026-02-08 19:53:29
【一起学Python】第12天:字符串类型String详细使用总结
字符串是 Python 中最常用的数据类型。我们可以使用引号( ' 或 " )来创建字符串。

一、字符串的创建

# 单引号s1 = 'Hello'# 双引号s2 = "World"# 三引号(多行字符串)s3 = '''这是多行字符串'''s4 = """也可以使用双引号"""# 原始字符串(不转义)s5 = r'C:\Users\name'  # 不会把\n当成换行# 字节字符串s6 = b'Hello'  # bytes类型# Unicode字符串(Python 3默认)s7 = 'Hello 世界 🌍'# 空字符串empty = ''empty2 = str()# 字符串拼接s = 'Hello' + ' ' + 'World'print(s)  # 'Hello World'# 字符串重复s = 'Ha' * 3print(s)  # 'HaHaHa'

二、字符串索引和切片

s = 'Python'# 正向索引print(s[0])   # 'P'print(s[1])   # 'y'print(s[5])   # 'n'# 反向索引print(s[-1])  # 'n' (最后一个)print(s[-2])  # 'o'print(s[-6])  # 'P'# 切片 [start:stop:step]print(s[0:3])    # 'Pyt'print(s[:3])     # 'Pyt' (从开头)print(s[3:])     # 'hon' (到结尾)print(s[:])      # 'Python' (完整复制)# 带步长print(s[::2])    # 'Pto' (每隔一个)print(s[1::2])   # 'yhn'# 反转字符串print(s[::-1])   # 'nohtyP'# 负数切片print(s[-3:])    # 'hon' (最后3个)print(s[:-3])    # 'Pyt' (除了最后3个)# 切片越界不报错print(s[10:])    # '' (空字符串)print(s[:100])   # 'Python'

三、字符串方法(50+个)

1. 大小写转换

s = 'Hello World'# 全部大写print(s.upper())  # 'HELLO WORLD'# 全部小写print(s.lower())  # 'hello world'# 首字母大写print(s.capitalize())  # 'Hello world'# 每个单词首字母大写print(s.title())  # 'Hello World'# 大小写互换print(s.swapcase())  # 'hELLO wORLD'# 判断print(s.isupper())  # Falseprint(s.islower())  # Falseprint(s.istitle())  # True

2. 查找和替换

s = 'Hello World, Hello Python'# 查找子串(返回索引)print(s.find('World'))  # 6print(s.find('Java'))   # -1 (未找到)# 从右边查找print(s.rfind('Hello'))  # 13# 查找(未找到抛异常)print(s.index('World'))  # 6# print(s.index('Java'))  # ValueError# 统计出现次数print(s.count('Hello'))  # 2print(s.count('o'))      # 4# 替换print(s.replace('Hello''Hi'))  # 'Hi World, Hi Python'# 替换指定次数print(s.replace('Hello''Hi', 1))  # 'Hi World, Hello Python'# 判断开头print(s.startswith('Hello'))  # Trueprint(s.startswith('Hi'))     # False# 判断结尾print(s.endswith('Python'))  # Trueprint(s.endswith('Java'))    # False

3. 分割和连接

# split() - 分割字符串s = 'apple,banana,orange'print(s.split(','))  # ['apple''banana''orange']s = 'one two  three   four'print(s.split())  # 默认按空白分割# ['one''two''three''four']# 限制分割次数s = 'a-b-c-d'print(s.split('-'2))  # ['a''b''c-d']# rsplit() - 从右边分割print(s.rsplit('-'1))  # ['a-b-c''d']# splitlines() - 按行分割s = 'line1\nline2\nline3'print(s.splitlines())  # ['line1''line2''line3']# partition() - 分成三部分s = 'hello-world'print(s.partition('-'))  # ('hello''-''world')# join() - 连接字符串words = ['apple''banana''orange']print(','.join(words))  'apple,banana,orange'print(' '.join(words))  'apple banana orange'# 连接数字需要先转字符串numbers = [123]print(','.join(map(str, numbers)))  '1,2,3'

4. 去除空白

s = '  Hello World  '# 去除两端空白print(s.strip())   # 'Hello World'# 去除左边空白print(s.lstrip())  # 'Hello World  '# 去除右边空白print(s.rstrip())  # '  Hello World'# 去除指定字符s = '***Hello***'print(s.strip('*'))  # 'Hello's = 'www.example.com'print(s.strip('cmowz.'))  # 'example'# 去除换行符s = 'Hello\n'print(s.rstrip('\n'))  # 'Hello'

5. 对齐和填充

s = 'Hello'# 左对齐print(s.ljust(10))       # 'Hello     'print(s.ljust(10, '*'))  # 'Hello*****'# 右对齐print(s.rjust(10))       # '     Hello'print(s.rjust(10, '*'))  # '*****Hello'# 居中print(s.center(10))      # '  Hello   'print(s.center(10, '*')) # '**Hello***'# 填充0(数字)num = '42'print(num.zfill(5))  # '00042'num = '-42'print(num.zfill(5))  # '-0042'

6. 判断类型

# 是否全是字母print('Hello'.isalpha())   # Trueprint('Hello123'.isalpha()) # False# 是否全是数字print('123'.isdigit())   # Trueprint('12.3'.isdigit())  # False# 是否全是字母或数字print('Hello123'.isalnum())  # Trueprint('Hello 123'.isalnum()) # False# 是否全是空白print('   '.isspace())  # Trueprint(' a '.isspace())  # False# 是否全是小写print('hello'.islower())  # Trueprint('Hello'.islower())  # False# 是否全是大写print('HELLO'.isupper())  # Trueprint('Hello'.isupper())  # False# 是否是标题格式print('Hello World'.istitle())  # Trueprint('Hello world'.istitle())  # False# 是否是十进制数字print('123'.isdecimal())  # Trueprint('½'.isdecimal())    # False# 是否是数字(包括Unicode数字)print('123'.isnumeric())  # Trueprint('½'.isnumeric())    # Trueprint('Ⅳ'.isnumeric())    # True (罗马数字)# 是否是合法标识符print('variable'.isidentifier())  # Trueprint('123abc'.isidentifier())    # Falseprint('_var'.isidentifier())      # True# 是否可打印print('Hello'.isprintable())  # Trueprint('Hello\n'.isprintable()) # False# 是否是ASCIIprint('Hello'.isascii())  # Trueprint('你好'.isascii())   # False

7. 编码和解码

# 编码为字节s = 'Hello 世界'bytes_utf8 = s.encode('utf-8')print(bytes_utf8)  # b'Hello \xe4\xb8\x96\xe7\x95\x8c'bytes_gbk = s.encode('gbk')print(bytes_gbk)  # b'Hello \xca\xc0\xbd\xe7'# 解码为字符串s = bytes_utf8.decode('utf-8')print(s)  # 'Hello 世界'# 处理编码错误bytes_data = b'\xff\xfe'print(bytes_data.decode('utf-8', errors='ignore'))  # 忽略错误print(bytes_data.decode('utf-8', errors='replace')) # 替换为�

8. 格式化

# 旧式格式化(%)name = 'Alice'age = 25print('Name: %s, Age: %d' % (name, age))  # 'Name: Alice, Age: 25'# format() 方法print('Name: {}, Age: {}'.format(name, age))  # 'Name: Alice, Age: 25'print('Name: {0}, Age: {1}'.format(name, age))  # 'Name: Alice, Age: 25'print('Name: {n}, Age: {a}'.format(n=name, a=age))  # 'Name: Alice, Age: 25'# f-string (Python 3.6+,推荐)print(f'Name: {name}, Age: {age}')  # 'Name: Alice, Age: 25'# f-string 表达式x, y = 1020print(f'{x} + {y} = {x + y}')  # '10 + 20 = 30'# f-string 格式化pi = 3.141592653589793print(f'π ≈ {pi:.2f}')  # 'π ≈ 3.14'# f-string 调用方法name = 'alice'print(f'Hello, {name.upper()}!')  # 'Hello, ALICE!'# f-string 字典person = {'name''Bob''age'30}print(f"Name: {person['name']}, Age: {person['age']}")  # 'Name: Bob, Age: 30'# f-string 调试(Python 3.8+)x = 10print(f'{x=}')  # 'x=10'

四、字符串格式化详解

# 1. 基本格式化name = 'Alice'age = 25# 位置参数print('{} is {} years old'.format(name, age))# 'Alice is 25 years old'# 索引参数print('{0} is {1} years old'.format(name, age))# 'Alice is 25 years old'# 关键字参数print('{n} is {a} years old'.format(n=name, a=age))# 'Alice is 25 years old'# 2. 数字格式化num = 42# 二进制print('{:b}'.format(num))  # '101010'# 八进制print('{:o}'.format(num))  # '52'# 十六进制print('{:x}'.format(num))  # '2a'print('{:X}'.format(num))  # '2A'# 3. 浮点数格式化pi = 3.141592653589793# 保留小数print('{:.2f}'.format(pi))  # '3.14'print('{:.4f}'.format(pi))  # '3.1416'# 科学计数法print('{:.2e}'.format(1234567))  # '1.23e+06'print('{:.2E}'.format(1234567))  # '1.23E+06'# 百分比print('{:.2%}'.format(0.85))  # '85.00%'# 4. 对齐text = 'Hello'# 左对齐print('{:<10}'.format(text))  # 'Hello     '# 右对齐print('{:>10}'.format(text))  # '     Hello'# 居中print('{:^10}'.format(text))  # '  Hello   '# 填充字符print('{:*<10}'.format(text))  # 'Hello*****'print('{:*>10}'.format(text))  # '*****Hello'print('{:*^10}'.format(text))  # '**Hello***'# 5. 千位分隔符num = 1234567890print('{:,}'.format(num))  # '1,234,567,890'print('{:_}'.format(num))  # '1_234_567_890'# 6. 正负号print('{:+}'.format(42))   # '+42'print('{:+}'.format(-42))  # '-42'print('{: }'.format(42))   # ' 42'# 7. 组合使用price = 1234.5print('{:>10,.2f}'.format(price))  # '  1,234.50'

五、字符串常见操作

1. 字符串拼接

# 方法1:+ 运算符s1 = 'Hello's2 = 'World'result = s1 + ' ' + s2print(result)  # 'Hello World'# 方法2:join()(推荐,更高效)words = ['Hello''World']result = ' '.join(words)print(result)  # 'Hello World'# 方法3:f-stringname = 'Alice'age = 25result = f'{name} is {age} years old'print(result)  # 'Alice is 25 years old'# 方法4:format()result = '{} is {} years old'.format(name, age)print(result)  # 'Alice is 25 years old'# 方法5:% 格式化result = '%s is %d years old' % (name, age)print(result)  # 'Alice is 25 years old'# ⚠️ 性能对比:大量拼接时# ❌ 低效result = ''for i in range(1000):    result += str(i)  # 每次创建新字符串# ✅ 高效result = ''.join(str(i) for i in range(1000))

2. 字符串反转

s = 'Hello'# 方法1:切片(最简单)print(s[::-1])  # 'olleH'# 方法2:reversed() + join()print(''.join(reversed(s)))  # 'olleH'# 方法3:递归def reverse_recursive(s):    if len(s) <= 1:        return s    return reverse_recursive(s[1:]) + s[0]print(reverse_recursive(s))  # 'olleH'

3. 字符串去重

s = 'hello'# 方法1:set + join(不保持顺序)print(''.join(set(s)))  # 'helo' (顺序不定)# 方法2:保持顺序def remove_duplicates(s):    seen = set()    result = []    for char in s:        if char not in seen:            seen.add(char)            result.append(char)    return ''.join(result)print(remove_duplicates(s))  # 'helo'# 方法3:dict.fromkeys()(Python 3.7+保持顺序)print(''.join(dict.fromkeys(s)))  # 'helo'

4. 字符串匹配

import res = 'My email is alice@example.com and bob@test.com'# 查找所有邮箱emails = re.findall(r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b', s)print(emails)  # ['alice@example.com', 'bob@test.com']# 替换result = re.sub(r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b'                '[EMAIL]', s)print(result)  # 'My email is [EMAIL] and [EMAIL]'# 分割s = 'apple, banana; orange|grape'result = re.split(r'[,;|]', s)print(result)  # ['apple', ' banana', ' orange', 'grape']# 匹配pattern = r'^[A-Za-z0-9]+$'print(re.match(pattern, 'Hello123'))  # Match对象print(re.match(pattern, 'Hello 123')) # None

六、字符串实战案例

案例1:验证输入

def validate_email(email):    """验证邮箱格式"""    import re    pattern = r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$'    return bool(re.match(pattern, email))print(validate_email('alice@example.com'))  # Trueprint(validate_email('invalid.email'))      # Falsedef validate_phone(phone):    """验证手机号(中国)"""    import re    pattern = r'^1[3-9]\d{9}$'    return bool(re.match(pattern, phone))print(validate_phone('13812345678'))  # Trueprint(validate_phone('12345678901'))  # Falsedef validate_password(password):    """验证密码强度(至少8位,包含大小写字母和数字)"""    if len(password) < 8:        return False    has_upper = any(c.isupper() for c in password)    has_lower = any(c.islower() for c in password)    has_digit = any(c.isdigit() for c in password)    return has_upper and has_lower and has_digitprint(validate_password('Abc12345'))  # Trueprint(validate_password('abc12345'))  # False (无大写)

案例2:文本处理

def word_count(text):    """统计单词数"""    words = text.split()    return len(words)def char_count(text, ignore_space=True):    """统计字符数"""    if ignore_space:        text = text.replace(' ''')    return len(text)def most_common_word(text):    """找出最常见的单词"""    from collections import Counter    words = text.lower().split()    counter = Counter(words)    return counter.most_common(1)[0]text = 'hello world hello python hello'print(word_count(text))  # 5print(char_count(text))  # 25print(most_common_word(text))  # ('hello', 3)

案例3:字符串加密

def caesar_cipher(text, shift=3):    """凯撒密码加密"""    result = []    for char in text:        if char.isalpha():            start = ord('A'if char.isupper() else ord('a')            shifted = (ord(char) - start + shift) % 26 + start            result.append(chr(shifted))        else:            result.append(char)    return ''.join(result)def caesar_decipher(text, shift=3):    """凯撒密码解密"""    return caesar_cipher(text, -shift)text = 'Hello World'encrypted = caesar_cipher(text, 3)print(encrypted)  # 'Khoor Zruog'decrypted = caesar_decipher(encrypted, 3)print(decrypted)  # 'Hello World'

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-08 22:46:30 HTTP/2.0 GET : https://f.mffb.com.cn/a/474390.html
  2. 运行时间 : 0.191208s [ 吞吐率:5.23req/s ] 内存消耗:4,494.43kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=e5b18a3f6be728a133422284656d72f1
  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.000462s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000721s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000303s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000270s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000608s ]
  6. SELECT * FROM `set` [ RunTime:0.007317s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000638s ]
  8. SELECT * FROM `article` WHERE `id` = 474390 LIMIT 1 [ RunTime:0.000614s ]
  9. UPDATE `article` SET `lasttime` = 1770561990 WHERE `id` = 474390 [ RunTime:0.002029s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000841s ]
  11. SELECT * FROM `article` WHERE `id` < 474390 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.003002s ]
  12. SELECT * FROM `article` WHERE `id` > 474390 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000543s ]
  13. SELECT * FROM `article` WHERE `id` < 474390 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.027006s ]
  14. SELECT * FROM `article` WHERE `id` < 474390 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.021050s ]
  15. SELECT * FROM `article` WHERE `id` < 474390 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.032563s ]
0.192865s