PHP unserialize fails with non-encoded characters?

后端 未结 14 1710
遥遥无期
遥遥无期 2020-11-27 16:13
$ser = \'a:2:{i:0;s:5:\"héllö\";i:1;s:5:\"wörld\";}\'; // fails
$ser2 = \'a:2:{i:0;s:5:\"hello\";i:1;s:5:\"world\";}\'; // works
$out = unserialize($ser);
$out2 = un         


        
14条回答
  •  独厮守ぢ
    2020-11-27 16:50

    I would advise you to use javascript to encode as json and then use json_decode to unserialize.

提交回复
热议问题