开发者

How do you work with SESSION variable that is an object and also serialized?

开发者 https://www.devze.com 2023-01-30 14:52 出处:网络
I am trying to assign a value to an item within the serializedobject variable.How do I go about that?I have pasted below an excerpt of what the 开发者_Python百科SESSION array looks like as key/value.

I am trying to assign a value to an item within the serialized object variable. How do I go about that? I have pasted below an excerpt of what the 开发者_Python百科SESSION array looks like as key/value.

selected_region=18

delivery_region=18

cart=O:9:"cart":40:{s:16:"delivery_country";s:2:"US";s:16:"selected_country";s:2:"US";s:15:"delivery_region";s:2:"18";s:15:"selected_region";s:2:"18";s:24:"selected_shipping_method";s:9:"tablerate";s:24:"selected_shipping_option";s:10:"Table Rate";s:24:"selected_shipping_amount";d:8;s:6:"coupon";N;s:14:"tax_percentage";s:1:"0";s:9:"unique_id";s:40:"cdaa5a32e39b5470f21f43dd847e8cb1eb3d9327";s:6:"errors";a:0:{}s:9:"total_tax";i:0;s:13:"base_shipping";N;s:19:"total_item_shipping";N;s:14:"total_shipping";N;s:8:"subtotal";i:0;s:11:"total_price";N;s:13:"uses_shipping";N;s:13:"is_incomplete";b:1;s:10:"cart_items";a:0:{}s:9:"cart_item";O:14:"cart_item":34:

I am trying to assign say "selected_shipping_amount" to another value. How can I reach into that and assign it?

Thanks...


I think your only option is to unserialize it, assign the value and then serialize it again.

0

精彩评论

暂无评论...
验证码 换一张
取 消