Unserialize a string
1 2 3 4 |
$test=unserialize('a:8:{s:3:"sku";s:0:"";s:8:"products";a:3:{i:1;a:3:{s:6:"option";s:3:"ttt";s:5:"price";s:3:"111";s:9:"saleprice";s:0:"";}i:2;a:3:{s:6:"option";s:3:"eee";s:5:"price";s:3:"222";s:9:"saleprice";s:0:"";}i:3;a:3:{s:6:"option";s:0:"";s:5:"price";s:0:"";s:9:"saleprice";s:0:"";}}s:11:"description";s:0:"";s:8:"shiprate";s:1:"F";s:8:"featured";s:2:"no";s:4:"sale";s:2:"no";s:10:"cart_radio";s:1:"0";s:6:"optset";s:0:"";}'); print_r($test); echo $test[products][1][price]; |