


What characters in php will affect the parsing of unserialize()?
Aug 18, 2016 am 09:16 AMWhat characters in PHP will affect the parsing of unserialize?
Reply content:
What characters in PHP will affect the parsing of unserialize?
Correct answer upstairs
For example, under utf8 encoding
echo serialize('我'); //输出: s:3:"我";
under gbk encoding
echo serialize('我'); //输出:s:2:"我";
So you can never serialize the 3-byte long 'I' under utf8 encoding and deserialize under gbk encoding parsed out
I think it should be caused by the inconsistency between the encoding when serializing the data and the encoding when deserializing, or you can post the wrong statement for easy analysis
/
In the past two days, I I have encountered
The above is what characters in PHP will affect the parsing of unserialize()? For more related content, please pay attention to the PHP Chinese website (www.php.cn)!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian

How To Set Up Visual Studio Code (VS Code) for PHP Development
