Unserializing data doesn't work

前端 未结 3 1233
迷失自我
迷失自我 2021-01-21 13:35

Been at this for the past 5 hours and I\'m stumped. Tried the most ridiculous functions to try and fix it but to no avail.

I\'m retrieving data from a WP database. The

3条回答
  •  轮回少年
    2021-01-21 13:56

    I had the same problem with wp_options where custom post types have serialize data. I've figure that maybe there was a charset issue, and in fact... ta da! Try this:

    $unserialized = unserialize( utf8_encode($atest[0]['option_value'] ) );
    

    Where $atest[0] is thearray from mysql. Hope this helps!

    Aisfrond

提交回复
热议问题