How to extract data from a post meta serialized array in Wordpress

you can simply extract your post meta serialized array data with wordpress maybe_unserialize function.

$get_product_ids = get_post_meta( $current_post_id );

$mydata = unserialize($get_product_ids['array_key'][0]);

$myunserializedata =  maybe_unserialize(unserialize ($get_product_ids['array_key'][0]));

$my_new_data = $myunserializedata['your_post_meta_key'];

You can simply check both $mydata and  $my_new_data values and find the difference between two !! 

Post a Comment

0 Comments