Title: Getting a error: Array to string conversion
Last modified: January 16, 2017

---

# Getting a error: Array to string conversion

 *  Resolved [tfadz](https://wordpress.org/support/users/tfadz/)
 * (@tfadz)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/getting-a-error-array-to-string-conversion/)
 * Hi, i’m getting an error when I test my page out with the plugin.
 * “Notice: Array to string conversion in..”
 * This is my code. I’m using a repeater field. $relatedLink is the acf that I’m
   using for the page link.
 *     ```
       <?php if(have_rows('related_content')) : while(have_rows('related_content')) : the_row(); 
                  $relatedTitle = get_sub_field('related_title');
                  $relatedLink  = get_sub_field('related_link');
          ?>
   
       <a href="<?php echo $relatedLink; ?>" class="fs-leader-related__block">Image</a>
   
       <?php endwhile; endif; ?>
       ```
   
 * Thanks
    -  This topic was modified 9 years, 4 months ago by [tfadz](https://wordpress.org/support/users/tfadz/).
    -  This topic was modified 9 years, 4 months ago by [tfadz](https://wordpress.org/support/users/tfadz/).
    -  This topic was modified 9 years, 4 months ago by [tfadz](https://wordpress.org/support/users/tfadz/).
    -  This topic was modified 9 years, 4 months ago by [tfadz](https://wordpress.org/support/users/tfadz/).
    -  This topic was modified 9 years, 4 months ago by [tfadz](https://wordpress.org/support/users/tfadz/).
    -  This topic was modified 9 years, 4 months ago by [tfadz](https://wordpress.org/support/users/tfadz/).

Viewing 1 replies (of 1 total)

 *  Plugin Author [Corey Worrell](https://wordpress.org/support/users/coreyw/)
 * (@coreyw)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/getting-a-error-array-to-string-conversion/#post-8662081)
 * Hi [@tfadz](https://wordpress.org/support/users/tfadz/)
 * The field returns an array and not a string.
 * \`
    $field = get_sub_field(‘related_link’); print_r($field); // array( // [url]
   => [http://site.com/page/](http://site.com/page/) // [title] => Page! // [target]
   => 0 // ) `

Viewing 1 replies (of 1 total)

The topic ‘Getting a error: Array to string conversion’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/acf-link_f7921e.svg)
 * [Advanced Custom Fields: Link](https://wordpress.org/plugins/acf-link/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/acf-link/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/acf-link/)
 * [Active Topics](https://wordpress.org/support/plugin/acf-link/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/acf-link/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/acf-link/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Corey Worrell](https://wordpress.org/support/users/coreyw/)
 * Last activity: [9 years, 4 months ago](https://wordpress.org/support/topic/getting-a-error-array-to-string-conversion/#post-8662098)
 * Status: resolved