Php 这是什么字符串格式?如何解码
我在WordPress主题数据库的meta_值部分找到了这个Php 这是什么字符串格式?如何解码,php,json,wordpress,string,Php,Json,Wordpress,String,我在WordPress主题数据库的meta_值部分找到了这个 a:2:{i:0;i:141;i:1;i:462;}这是一个序列化数组。 您可以使用以下代码对其进行解码并通过PHP访问它 <?php //Decode the string $decode = unserialize('a:2:{i:0;i:141;i:1;i:462;}'); //Decode will give you this Array ( [0] => 141 [1] => 462 ) /
a:2:{i:0;i:141;i:1;i:462;}这是一个序列化数组。 您可以使用以下代码对其进行解码并通过PHP访问它
<?php
//Decode the string
$decode = unserialize('a:2:{i:0;i:141;i:1;i:462;}');
//Decode will give you this
Array (
[0] => 141
[1] => 462
)
//Accessible by
echo $decode[0]; //will give you 141
echo $decode[0]; //will give you 462
?>
这是序列化的