drmeu26880
drmeu26880
2018-07-09 04:48
浏览 40
已采纳

在PHP中反序列化数据

Item_id= 123200194926 and transaction_id=1970816179002

How can I get the item_id and transaction_id from the below

a: 1: {
  s: 16: "m2epro_extension";
  a: 1: {
    s: 5: "items";
    a: 1: {
      i: 0;
      a: 2: {
        s: 7: "item_id";
        s: 12: "123200194926";
        s: 14: "transaction_id";
        s: 13: "1970816179002";
      }
    }
  }
}
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongluo6343
    dongluo6343 2018-07-09 05:01
    已采纳

    I got the solution:

    print_r(unserialize($_item->getAdditionalData()));
    

    Result:

    Array
    (
        [m2epro_extension] => Array
            (
                [items] => Array
                    (
                        [0] => Array
                            (
                                [item_id] => 123200194926
                                [transaction_id] => 1970816179002
                            )
    
                    )
    
            )
    
    )
    
    点赞 评论

相关推荐