2016-10-07 8 views
1

私のデータをシリアライズすると、シリアライズ解除が必要になります。シリアライズしてデータをシリアライズする

どうすれば可能ですか?

array(5) { 
    [0]=> 
    string(970) "a:7:{s:4:"type";s:46:"Magento\SalesRule\Model\Rule\Condition\Combine";s:9:"attribute";N;s:8:"operator";N;s:5:"value";s:1:"1";s:18:"is_value_processed";N;s:10:"aggregator";s:3:"all";s:10:"conditions";a:4:{i:0;a:5:{s:4:"type";s:46:"Magento\SalesRule\Model\Rule\Condition\Address";s:9:"attribute";s:13:"base_subtotal";s:8:"operator";s:2:">=";s:5:"value";s:3:"100";s:18:"is_value_processed";b:0;}i:1;a:5:{s:4:"type";s:46:"Magento\SalesRule\Model\Rule\Condition\Address";s:9:"attribute";s:14:"payment_method";s:8:"operator";s:2:"==";s:5:"value";s:24:"paypal_billing_agreement";s:18:"is_value_processed";b:0;}i:2;a:5:{s:4:"type";s:46:"Magento\SalesRule\Model\Rule\Condition\Address";s:9:"attribute";s:9:"region_id";s:8:"operator";s:2:"!=";s:5:"value";s:3:"321";s:18:"is_value_processed";b:0;}i:3;a:5:{s:4:"type";s:46:"Magento\SalesRule\Model\Rule\Condition\Address";s:9:"attribute";s:9:"total_qty";s:8:"operator";s:2:"==";s:5:"value";s:2:"30";s:18:"is_value_processed";b:0;}}}" 
    [1]=> 
    string(398) "a:7:{s:4:"type";s:46:"Magento\SalesRule\Model\Rule\Condition\Combine";s:9:"attribute";N;s:8:"operator";N;s:5:"value";s:1:"1";s:18:"is_value_processed";N;s:10:"aggregator";s:3:"all";s:10:"conditions";a:1:{i:0;a:5:{s:4:"type";s:46:"Magento\SalesRule\Model\Rule\Condition\Address";s:9:"attribute";s:15:"shipping_method";s:8:"operator";s:2:"==";s:5:"value";s:5:"dhl_M";s:18:"is_value_processed";b:0;}}}" 
    [2]=> 
    string(390) "a:7:{s:4:"type";s:46:"Magento\SalesRule\Model\Rule\Condition\Combine";s:9:"attribute";N;s:8:"operator";N;s:5:"value";s:1:"1";s:18:"is_value_processed";N;s:10:"aggregator";s:3:"all";s:10:"conditions";a:1:{i:0;a:5:{s:4:"type";s:46:"Magento\SalesRule\Model\Rule\Condition\Address";s:9:"attribute";s:10:"country_id";s:8:"operator";s:2:"==";s:5:"value";s:2:"AS";s:18:"is_value_processed";b:0;}}}" 
    [3]=> 
    string(619) "a:7:{s:4:"type";s:46:"Magento\SalesRule\Model\Rule\Condition\Combine";s:9:"attribute";N;s:8:"operator";N;s:5:"value";s:1:"1";s:18:"is_value_processed";N;s:10:"aggregator";s:3:"all";s:10:"conditions";a:1:{i:0;a:7:{s:4:"type";s:56:"Magento\SalesRule\Model\Rule\Condition\Product\Subselect";s:9:"attribute";s:3:"qty";s:8:"operator";s:2:"==";s:5:"value";s:1:"1";s:18:"is_value_processed";N;s:10:"aggregator";s:3:"all";s:10:"conditions";a:1:{i:0;a:5:{s:4:"type";s:46:"Magento\SalesRule\Model\Rule\Condition\Product";s:9:"attribute";s:5:"color";s:8:"operator";s:2:"==";s:5:"value";s:2:"52";s:18:"is_value_processed";b:0;}}}}}" 
    [4]=> 
    string(390) "a:7:{s:4:"type";s:46:"Magento\SalesRule\Model\Rule\Condition\Combine";s:9:"attribute";N;s:8:"operator";N;s:5:"value";s:1:"1";s:18:"is_value_processed";N;s:10:"aggregator";s:3:"all";s:10:"conditions";a:1:{i:0;a:5:{s:4:"type";s:46:"Magento\SalesRule\Model\Rule\Condition\Address";s:9:"attribute";s:8:"postcode";s:8:"operator";s:2:"==";s:5:"value";s:5:"46487";s:18:"is_value_processed";b:0;}}}" 
} 
+0

を試してみましたでしょうか?あなたが望む結果は何ですか? –

+1

https://eval.in/657045これはあなたが欲しいものですか? –

+0

私は上記のunserializeを必要とし、次に他のデータベーステーブルfeild @Anantでフィルタが必要です。 –

答えて

3

あなたは、以下の方法でforeach()unserialize()を使用することができます - あなたは

$unserialized = array(); 

foreach ($data as $serialized) { 
    $unserialized[] = unserialize($serialized); 
} 
関連する問題