Title: Echo/Print Values from Hyperlink PHP Array
Last modified: March 11, 2017

---

# Echo/Print Values from Hyperlink PHP Array

 *  Resolved [dawnrae](https://wordpress.org/support/users/dawnrae/)
 * (@dawnrae)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/echoprint-values-from-hyperlink-php-array/)
 * I am hoping to use the Hyperlink Output as PHP Array to add links to a page, 
   which I believe will allow me to add code around each value (url, text, target).
   I have having trouble however, determine how to output the values. Anyone have
   experience with this and willing to share?

Viewing 1 replies (of 1 total)

 *  Thread Starter [dawnrae](https://wordpress.org/support/users/dawnrae/)
 * (@dawnrae)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/echoprint-values-from-hyperlink-php-array/#post-8903579)
 * Whew! I figured it out finally. Sharing here in case anyone needs it:
 *     ```
       $my_links = CFS()->get('hyperlink_field_name',$post_id);
       $keys = array_keys($my_links);
       $values = array_values($my_links);
       echo '<a href="'.$values[0].'" target="'.$values[2].'">'.$values[1].'</a>';
       ```
   
 * If you wish to include it within a loop:
 *     ```
       $my_links = $cfs->get('loop_field_name', $post_id);
       foreach ($my_links as $field) {
       $keys = array_keys($field['hyperlink_field_name']);
       $values = array_values($field['hyperlink_field_name']);
       echo '<a href="'.$values[0].'" target="'.$values[2].'">'.$values[1].'</a>';
       }
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Echo/Print Values from Hyperlink PHP Array’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-field-suite.svg)
 * [Custom Field Suite](https://wordpress.org/plugins/custom-field-suite/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-field-suite/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-field-suite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-field-suite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-field-suite/reviews/)

## Tags

 * [array](https://wordpress.org/support/topic-tag/array/)
 * [hyperlink](https://wordpress.org/support/topic-tag/hyperlink/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 1 reply
 * 1 participant
 * Last reply from: [dawnrae](https://wordpress.org/support/users/dawnrae/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/echoprint-values-from-hyperlink-php-array/#post-8903579)
 * Status: resolved