当前位置:网站首页>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");
//得到结果为浙江
边栏推荐
- A tour of gRPC:05 - gRPC server straming 服务端流
- SDL2 简明教程(四):用 SDL_IMAGE 库导入图片
- 李宏毅《机器学习》丨5. Tips for neural network design(神经网络设计技巧)
- 记录一下 clearfix 清除浮动
- Pyqt5 rapid development and practice 5.1 tables and trees
- The deep displacement monitoring system wk813 is used to measure the deep displacement of slopes, dams, embankments, railways and building foundation pit excavation
- JS linked list 01
- LabVIEW LINX Toolkit控制Arduino设备(拓展篇—1)
- Pyqt5 rapid development and practice 5.2 container: load more controls
- A program for judging the result of cyclic input
猜你喜欢

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

2021 亚鸿笔试题

MLX90640 红外热成像仪测温传感器模块开发笔记(八)

Food safety | these two kinds of melons and fruits should be improved, especially for pregnant women with constipation

两种特殊函数(箭头函数和方法)
![[Multisim Simulation] LM339 zero crossing circuit simulation](/img/ca/f6dae5fd298c00570407c2bdfa5118.png)
[Multisim Simulation] LM339 zero crossing circuit simulation

Vm501 development kit development version single vibrating wire sensor acquisition module geotechnical engineering monitoring

NTC, PT100 thermal resistance to 4-20mA temperature signal converter

Summary of for loop in JS

One channel encoder, two channels Di speed measurement, RS485 serial port connected to one channel do alarm module ibf151
随机推荐
Advantages of optical rain gauge over tipping bucket rain gauge
深部位移监测系统wk813应用边坡、大坝、堤防、铁路和建筑基坑开挖等深部位移测量
R language uses file of FS package_ Delete function deletes the specified file under the specified folder, draw inferences from one instance, dir_ Delete function, link_ The delete function can be use
Learning methods 123
【微信小程序开发(七)】订阅消息
Multipurpose mixed signal 8ai/4di/do to serial port rs485/232modbus acquisition module ibf30
I'll show you a little chat! Summary of single merchant function modules
Basic structure and operation principle of solar street lamp
2021 Yahong pen test questions
Pyqt5 rapid development and practice 5.1 tables and trees
Fifth uncle's thinking
五舅的思考
Summary of for loop in JS
远距离串口服务器( 适配器)UART 转 1-Wire 应用
JS bidirectional linked list 01
Proportional solenoid valve control valve 4-20mA to 0-165ma/330ma signal isolation amplifier
A failed cracking experience
Why do most people who learn programming go to Shenzhen and Beijing?
QT打包
Redis series 4: sentinel (sentinel mode) with high availability