Title: Get from Array
Last modified: May 22, 2021

---

# Get from Array

 *  Resolved [befla.net](https://wordpress.org/support/users/beflanet/)
 * (@beflanet)
 * [5 years ago](https://wordpress.org/support/topic/get-from-array/)
 * Hi. Very nice plugin.
 * I´m using shopmagic example plugin for to get custom placeholders which works
   for me.
    Now I´m looking for a solution to get an output from a meta value. I
   have the meta_key `_op_payment_methods` and the meta_value `a:1:{i:0;a:15:{s:
   4:"name";s:5:"Sears";s:4:"code";s:24:"jetpack_custom_gateway_4";s:3:"ref";s:10:"
   qwertzuiop";s:11:"description";s:0:"";s:23:"paid_currency_formatted";s:5:"99.99";
   s:4:"paid";d:99.99;s:25:"return_currency_formatted";s:4:"0.00";s:6:"return";i:
   0;s:10:"paid_point";i:0;s:4:"type";s:7:"offline";s:11:"online_type";s:8:"external";
   s:7:"partial";b:0;s:10:"status_url";s:0:"";s:19:"allow_online_refund";s:2:"no";
   s:13:"callback_data";a:0:{}}}`. Now I want to create a placeholder for to get“
   qwertzuiop”. Someone can give me a snippet? Thanks a lot.

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [Bartek](https://wordpress.org/support/users/bartj/)
 * (@bartj)
 * [5 years ago](https://wordpress.org/support/topic/get-from-array/#post-14485356)
 * Hi!
 * `meta_value` is serialized, but when you call `get_post_meta` assuming that you
   have an ID of the object (order) for the key you want, you will get returned 
   array.
 * Now all you have to do is to return value from that array, what would be like:
 *     ```
       $payment_meta = get_post_meta( $ID, '_op_payment_methods' );
       return $payment_meta['ref'];
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Get from Array’ is closed to new replies.

 * ![](https://ps.w.org/shopmagic-for-woocommerce/assets/icon-256x256.png?rev=2847401)
 * [ShopMagic - email automation](https://wordpress.org/plugins/shopmagic-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shopmagic-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shopmagic-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/shopmagic-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shopmagic-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shopmagic-for-woocommerce/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Bartek](https://wordpress.org/support/users/bartj/)
 * Last activity: [5 years ago](https://wordpress.org/support/topic/get-from-array/#post-14485356)
 * Status: resolved