Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 这是什么字符串格式?如何解码_Php_Json_Wordpress_String - Fatal编程技术网

Php 这是什么字符串格式?如何解码

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 ) /

我在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
)

//Accessible by
echo $decode[0]; //will give you 141
echo $decode[0]; //will give you 462

?>

这是序列化的