因此,我处理了所有与序列化相关的问题,并打了一些其他字符串,但是我无法弄清楚如何在php中反序列化此问题
a:26:{i:0;a:2:{s:4:"name";s:0:"";s:5:"value";N;}i:1;a:2:{s:4:"name";s:7:"account";s:5:"value";s:3:"771";}i:2;a:2:{s:4:"name";s:10:"passengers";s:5:"value";s:1:"1";}i:3;a:2:{s:4:"name";s:8:"triptype";s:5:"value";s:7:"One Way";}i:4;a:2:{s:4:"name";s:10:"cabinclass";s:5:"value";s:7:"Economy";}i:5;a:2:{s:4:"name";s:2:"id";s:5:"value";s:1:"4";}i:6;a:2:{s:4:"name";s:5:"empty";s:5:"value";s:5:"false";}i:7;a:2:{s:4:"name";s:12:"accountvalue";s:5:"value";s:18:"Pantanal / Cerrado";}i:8;a:2:{s:4:"name";s:6:"tagsid";s:5:"value";s:0:"";}i:9;a:2:{s:4:"name";s:11:"tagsidvalue";s:5:"value";s:0:"";}i:10;a:2:{s:4:"name";s:8:"location";s:5:"value";s:2:"30";}i:11;a:2:{s:4:"name";s:13:"locationvalue";s:5:"value";s:6:"Brazil";}i:12;a:2:{s:4:"name";s:9:"startdate";s:5:"value";s:10:"2018-07-05";}i:13;a:2:{s:4:"name";s:11:"departvalue";s:5:"value";s:96:"CNF - Tancredo Neves International (Confins International), Belo Horizonte, Minas Gerais, Brazil";}i:14;a:2:{s:4:"name";s:6:"depart";s:5:"value";s:3:"475";}i:15;a:2:{s:4:"name";s:11:"arrivevalue";s:5:"value";s:69:"CGH - Congonhas International Airport, São Paulo, São Paulo, Brazil";}i:16;a:2:{s:4:"name";s:6:"arrive";s:5:"value";s:3:"351";}i:17;a:2:{s:4:"name";s:13:"travellername";s:5:"value";s:14:"Rezende/Rosana";}i:18;a:2:{s:4:"name";s:8:"totalco2";s:5:"value";s:4:"0.09";}i:19;a:2:{s:4:"name";s:3:"ref";s:5:"value";s:10:"1423093921";}i:20;a:2:{s:4:"name";s:9:"admincode";s:5:"value";s:8:"19070223";}i:21;a:2:{s:4:"name";s:14:"departmentcode";s:5:"value";s:13:"'0939.9070.01";}i:22;a:2:{s:4:"name";s:8:"costcode";s:5:"value";s:9:"1423.1.00";}i:23;a:2:{s:4:"name";s:11:"projectcode";s:5:"value";s:17:"Cerrado Pantanal ";}i:24;a:2:{s:4:"name";s:13:"purchaseorder";s:5:"value";s:9:"R$ 395,36";}i:25;a:2:{s:4:"name";s:5:"notes";s:5:"value";s:134:"Reunião do Subcomitê da Bacia do Jequitibá em Prudente de MoraeS Reuniões empresas pelo Selo Social. em Sete Lagoas de 24 a 05/07 ";}}
我相信上面的字符串是在PHP的某些旧版本中使用serialize($ string)函数构建的,而现在在7.2中使用unserialize函数是无法实现的。
有什么建议吗?
答案 0 :(得分:1)
我认为问题是各种非标准字符导致字符串长度指示器出现问题。如果您首先utf8_decode()
,它应该可以工作...
unserialize(utf8_decode($input))