string(13) "مغادرة1"......">

Serialization and utf-8 in PHP

Hi everyone, I'm trying to serialize an array containing some utf-8 code:

....["value"]=> string(13) "مغادرة1".... 

but after serializing the array it looks like this:

 value";s:13:"?????? 

I think the error I get is:

 Message: unserialize() [function.unserialize]: Error at offset 685 of 701 bytes 

due to incorrect serialization with utf-8 code
So how to serialize an array containing utf-8 code?
Thank you.

+4
source share
1 answer

Thanks for all the answers.
The problem was storing data in the database, not serialization, the type of field in which I stored ser content was Latin, I change it to utf-8, and everything works fine

+5
source

Source: https://habr.com/ru/post/1336780/


All Articles