title: How to correctly place PHP echo inside html span tags
body: <p>I've got the following function:</p>
  
  <pre><code>&lt;?php
  function my_custom_address ( $formats ) {
       $formats = array( 
          'default' =&gt; '&lt;span class="my-address-country"&gt;&lt;/span&gt;
                        &lt;span class="my-address-city"&gt;&lt;/span&gt;'
       ); 
       return $formats; 
  } 
  add_filter( 'default_address_formats', 'my_custom_address', 15 ) ;
  ?&gt;
  </code></pre>
  
  <p>And I'm trying to place the following output inside the span tags:</p>
  
  <pre><code>$listing_address_country = get_my_field( 'address_country' );
  echo $listing_address_country; 
  
  $listing_address_city = get_my_field( 'address_city' );
  echo $listing_address_city;
  </code></pre>
  
  <p>The closest I came up with the following:</p>
  
  <pre><code>function my_custom_address ( $formats ) {
  
       $listing_address_country = get_my_field( 'address_country' );
       $listing_address_city = get_my_field( 'address_city' );
       $formats = array( 
          'default' =&gt; echo '&lt;span class="my-address-country"&gt;' . $listing_address_country . '&lt;/span&gt;';
                   echo '&lt;span class="my-address-city"&gt;' . $listing_address_city . '&lt;/span&gt;';
       ); 
       return $formats; 
  } 
  add_filter( 'default_address_formats', 'my_custom_listing_address', 15 ) ;
  </code></pre>
  
  <p>But it's still not correct. I know I'm close, but I still seem to be missing something here.</p>