You concatenate with a period “.” in PHP
echo '<span>' . get_field('field_name') . '</span>';
If you want to concatenate to a variable, you can do the following:
$button = "";
$button .= '<a class="btn-main d-inline-block ' . esc_attr($a['class']) . '" href="' . esc_attr($a['href']) . '" style="' . esc_attr($a['style']) . '" target="' . esc_attr($a['target']) . '">';
$button .= '<span class="pt-2 pb-2 pl-4 pr-4 d-inline-block" style="border:1px solid white;">';
$button .= $content;
$button .= '</span>';
$button .= '</a>';
Declare the variable with an empty string and then add to it with “.=”
Have any questions or comments? Write them below!