php什么样的变量

php what is the kind of variable

我在 wp_postmeta 数据库中有一些数据,如下所示:

我在自定义 php 应用程序(不是 wordpress)中使用此数据,但我不知道如何访问数据,例如 artist 值是 13392

a:25:{s:10:"_transient";a:2:{s:7:"section";s:0:"";s:7:"expires";d:1575480361;}s:6:"artist";a:1:{i:0;s:5:"13392";}s:6:"player";s:9:"rx_player";s:6:"tracks";a:1:{i:0;a:18:{s:5:"title";s:8:"Jiyanewe";s:4:"type";s:3:"mp3";s:3:"mp3";s:62:"128.mp3";s:7:"history";s:0:"";s:6:"poster";s:0:"";s:10:"buy_icon_a";s:14:"fa fa-download";s:11:"buy_title_a";s:12:"Download 128";s:10:"buy_link_a";s:62:"128.mp3";s:10:"buy_icon_b";s:14:"fa fa-download";s:11:"buy_title_b";s:12:"Download 320";s:10:"buy_link_b";s:62:"320.mp3";s:10:"buy_icon_c";s:0:"";s:11:"buy_title_c";s:0:"";s:10:"buy_link_c";s:0:"";s:10:"buy_icon_d";s:0:"";s:11:"buy_title_d";s:0:"";s:10:"buy_link_d";s:0:"";s:10:"buy_custom";s:0:"";}}s:5:"embed";s:0:"";s:12:"player_cover";s:1:"1";s:8:"autoplay";s:1:"1";s:6:"repeat";s:1:"1";s:13:"loadringcolor";s:4:"#ddd";s:13:"playringcolor";s:7:"#ff0078";s:17:"waveformdatacolor";s:4:"#ccc";s:11:"eqdatacolor";s:7:"#7F1949";s:13:"peakdatacolor";s:7:"#ff33ff";s:5:"cover";s:1:"1";s:3:"img";s:0:"";s:3:"rev";s:1:"1";s:6:"master";s:1:"0";s:6:"layout";s:7:"inherit";s:7:"primary";s:7:"primary";s:9:"secondary";s:9:"secondary";s:8:"outer_bg";a:6:{s:5:"image";s:0:"";s:6:"repeat";s:0:"";s:8:"position";s:0:"";s:10:"attachment";s:0:"";s:4:"size";s:0:"";s:5:"color";s:0:"";}s:8:"inner_bg";a:6:{s:5:"image";s:0:"";s:6:"repeat";s:0:"";s:8:"position";s:0:"";s:10:"attachment";s:0:"";s:4:"size";s:0:"";s:5:"color";s:0:"";}s:14:"cover_position";s:0:"";s:11:"hiding_elms";s:0:"";s:13:"show_alphabet";s:0:"";}

数据序列化:

php> $data = serialize('hello world');
php> echo $data;
php> s:11:"hello world";
php> echo unserialize($data);
php> hello world

您的示例中的字符串缺少数据,如果您删除部分序列化字符串或更改序列化字符串而不更正它,您将无法反序列化它。