当前位置:网站首页>PHP mb_substr 中文乱码
PHP mb_substr 中文乱码
2022-07-28 15:17:00 【viqecel】
经过测试
$sheng=mb_substr('浙江省',0,2);
//得到结果为乱码
因为mb_substr()函数在使用时,需要在后面参数中指定编码.不指定.默认把中文当成三个字符.如果指定,则把中文当成一个字符来看待,所以
$sheng=mb_substr('浙江省',0,2,"utf-8");
//得到结果为浙江
边栏推荐
- 动态规划 --- 数位统计DP
- Telecommuting can be easily realized in only three steps
- 使用py,根据日志记录自动生成周报
- 2021-10-21 notes
- Application of optical rain gauge to rainfall detection
- leetcode 题目
- js 队列
- A failed cracking experience
- I came across Digital Phoenix coordinate Xuhui Meiluo city in Shanghai
- 5-channel di/do relay output remote IO acquisition module Modbus tcp/ibf95
猜你喜欢

LabVIEW Linx toolkit controls Arduino equipment (expansion-1)

12V pulse speed measurement to 24V level signal conversion transmitter

How to quickly access the unified authentication system

2021 亚鸿笔试题

js 数组(总结)

Proportional solenoid valve control valve 4-20mA to 0-165ma/330ma signal isolation amplifier

小程序中的分页查询

食品安全 | 这两类瓜果宜改善便秘 孕妇人群尤其建议

太阳能路灯的根本结构及作业原理

光学雨量计应用降雨量检测
随机推荐
Redis series 4: sentinel (sentinel mode) with high availability
Remember the common JS methods of projects
阿里云的rds mysql 只读实例在哪里创建
One channel encoder, two channels Di speed measurement, RS485 serial port connected to one channel do alarm module ibf151
R语言ggplot2可视化绘制线图(line plot)、使用gghighlight包突出高亮线图中满足组合判断条件的线图(satisfies both condition A and B)
Numpy ndarray learning < II > miscellaneous records
我在上海偶遇数字凤凰#坐标徐汇美罗城
Detectron2 installation and testing
JS array (summary)
Deeply understand the fusing configuration of istio traffic management
带你来浅聊一下!单商户功能模块汇总
Practical development tutorial of software problem repair tracking system (Part 1)
Let's learn the game of beating hamsters
Numpy ndarray learning < I > Foundation
Ethernet to RS485 serial port counter WiFi module LED light controller ibf165
A good start
Summary of for loop in JS
正大杯黑客马拉松数据解析竞赛
Zhaoqi science and technology innovation and entrepreneurship competition talent introduction platform, mass entrepreneurship and entrepreneurship competition high-level talent introduction
js 链表 01