duanji1610 2017-03-30 20:26
浏览 34
已采纳

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

i'm trying to get all values in this array stored in wp_option table. The array is:

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

What i need is just to get the values: development, apps, creativity.

I was trying:

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

but the output is:

developmentappscreativitydevelopmentappscreativitydevelopmentappscreativity

If i write:

var_dump ($option);

the output is:

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" 

Thanks in advance.

  • 写回答

1条回答 默认 最新

  • douduan9129 2017-03-30 20:29
    关注

    $myOptions = get_option('hashtag');

    echo $myOptions[0]

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据