How can I access the values stored in this array?
array(2) { [0]=> string(795) "a:23:{s:3:"add";s:1:"1";s:3:"cmd";s:5:"_cart";s:8:"business";s:18:"sales@sales.com";s:9:"item_name";s:16:"Where are we now";s:11:"item_number";s:5:"00005";s:6:"amount";s:5:"20.95";s:23:"buyer_credit_promo_code";s:0:"";s:29:"buyer_credit_product_category";s:0:"";s:28:"buyer_credit_shipping_method";s:0:"";s:32:"buyer_credit_user_address_change";s:0:"";s:8:"shipping";s:4:"6.00";s:9:"shipping2";s:4:"2.00";s:12:"shopping_url";s:29:"http://bookstore.astemari.com";s:6:"return";s:36:"http://www.sales.com/thankyou.php";s:13:"cancel_return";s:35:"http://www.sales.com/cancel.html";s:7:"no_note";s:1:"1";s:13:"currency_code";s:3:"USD";s:2:"lc";s:2:"US";s:8:"submit_x";s:2:"50";s:8:"submit_y";s:1:"9";s:8:"quantity";i:9;s:2:"id";i:1209123910;s:2:"ck";s:32:"e4ba5745d8eaf38e7e1184b65b46c501";}" [1]=> string(801) "a:23:{s:3:"add";s:1:"1";s:3:"cmd";s:5:"_cart";s:8:"business";s:18:"sales@sales.com";s:9:"item_name";s:22:"Strangers on the Shore";s:11:"item_number";s:5:"00004";s:6:"amount";s:5:"14.95";s:23:"buyer_credit_promo_code";s:0:"";s:29:"buyer_credit_product_category";s:0:"";s:28:"buyer_credit_shipping_method";s:0:"";s:32:"buyer_credit_user_address_change";s:0:"";s:8:"shipping";s:4:"6.00";s:9:"shipping2";s:4:"2.00";s:12:"shopping_url";s:29:"http://bookstore.astemari.com";s:6:"return";s:36:"http://www.sales.com/thankyou.php";s:13:"cancel_return";s:35:"http://www.sales.com/cancel.html";s:7:"no_note";s:1:"1";s:13:"currency_code";s:3:"USD";s:2:"lc";s:2:"US";s:8:"submit_x";s:2:"41";s:8:"submit_y";s:1:"6";s:8:"quantity";i:3;s:2:"id";i:1209123996;s:2:"ck";s:32:"02cfb3d031063eb8ec0c5f66b237ca2c";}" }
The array is store the the variable $_RETAIL
Help with accessing array in php
Moderator: General Moderators
-
dwain_francis
- Forum Newbie
- Posts: 7
- Joined: Wed Mar 26, 2008 11:45 pm
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: Help with accessing array in php
It looks like your array has been serialized - has it?
-
dwain_francis
- Forum Newbie
- Posts: 7
- Joined: Wed Mar 26, 2008 11:45 pm
Re: Help with accessing array in php
yes it has been serialized.
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: Help with accessing array in php
What you'll need to do is unserialize() it.
How do you want to access the array? By key, value etc...
How do you want to access the array? By key, value etc...
-
dwain_francis
- Forum Newbie
- Posts: 7
- Joined: Wed Mar 26, 2008 11:45 pm
Re: Help with accessing array in php
Ok, I need to access it by its value.
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: Help with accessing array in php
To access the values you would specify the keys associated with the value you want.
Can you post your array - unserialized()
Can you post your array - unserialized()