Well, I made a code that returns that serializated data:
a:3:{i:0;s:250:"Sistema Operativo: Windows Vista SP1 / Windows XP SP3
Procesador: Intel Core 2 Duo 1.8 Ghz, AMD Athlon X2 64 2.4 Ghz
Memoria: 1.5GB Windows Vista / 1GB Windows XP
Espacio en Disco: 16GB libres
Gráfica: 256MB NVIDIA 7900 / 256MB ATI X1900";i:1;s:281:"Sistema Operativo: Windows Vista SP1 / Windows XP SP3
MicroProcesador: Intel Core 2 Quad 2.4Ghz, AMD Phenom X3 2.1Ghz
RAM: 2.5GB Windows Vista / 2.5GB Windows XP
Espacio en Disco: 18GB libres
Gráfica: 512 MB NVIDIA 8600 / 512MB ATI 3870
Otros: DVD-ROM de doble capa";i:2;s:0:"";}
But when I unserialize it, it only returns 1...
I don't know why...
I use $data = (array)unserialize($quote);
but I had that weird problem that I don't know how to solve... :'(
EDIT:
There is my serialized variable $finalreq = serialize(array(0 => $minreq, 1 => $req, 2 => $maxreq));
$minreq, $req and $maxreq is a $_POST variable.
SOLVED:
If it happens to you the only thing you have to do is use a special function for UTF-8 characters called muti-byte unserialization.
The code:
/**
* Mulit-byte Unserialize
*
* UTF-8 will screw up a serialized string
*
* @access private
* @param string
* @return string
*/
function mb_unserialize($string) {
$string = preg_replace('!s:(\d+):"(.*?)";!se', "'s:'.strlen('$2').':\"$2\";'", $string);
return unserialize($string);
}
The original post: https://stackoverflow.com/a/5813058/3286975
Thanks.