Home > Backend Development > PHP Tutorial > 数组处理 a:2:{i:0;s:10:"11月25日";i:1;s:0:"你好";}

数组处理 a:2:{i:0;s:10:"11月25日";i:1;s:0:"你好";}

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-23 13:45:10
Original
1282 people have browsed it

如题在supesite 遇到 [customfieldtext] => a:2:{i:0;s:10:"11月25日";i:1;s:0:"你好";} 
怎么能够取到值  11月25日   和 你好


回复讨论(解决方案)

你用PHP的unserialize函数解析这段字符串试试

具体代码怎么闹呢

具体代码怎么闹呢

直接作为一个字符串,然后用函数执行

$s = 'a:2:{i:0;s:10:"11月25日";i:1;s:6:"你好";}';print_r(unserialize($s));
Copy after login
Array(    [0] => 11月25日    [1] => 你好)
Copy after login

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template