如何检索序列化数组中的所有值

时间:2017-03-30 20:26:33

标签: php arrays wordpress

我正在尝试将此数组中的所有值存储在wp_option表中。 该数组是:

a:3:{i:0;s:11:"development";i:1;s:4:"apps";i:2;s:10:"creativity";}

我需要的只是获取价值:开发应用创意

我在尝试:

$myOptions = get_option('hashtag');
foreach($myOptions as $option) {
echo $option;
}

但输出是:

developmentappscreativitydevelopmentappscreativitydevelopmentappscreativity

如果我写:

var_dump ($option);

输出是:

string(11) "development" string(4) "apps" string(10) "creativity" string(11) "development" string(4) "apps" string(10) "creativity" string(11) "development" string(4) "apps" string(10) "creativity" 

提前致谢。

1 个答案:

答案 0 :(得分:0)

$ myOptions = get_option('hashtag');

echo $ myOptions [0]

相关问题