HTML + PHP concatenation

Asked

Viewed 264 times

1

Can someone give me a light on better practice of variable concatenation.

I’m doing like this:

    $html="
    <td>
              <span class='campotitulo'>";
              echo $dadosboleto["codigodebarras"];
              $html = $html."</span>
    </td>";

Is there a more practical way? I have 700 lines to concatenate html and php.

*The final result of $html I will use in mPDF to generate a PDF page.

  • $html="<td><span class='fieldtitle'>"; echo $dadosbolet["codigodebarras"]; $html .= " </span></td>";

1 answer

1


You do so

$html="<td><span class='campotitulo'>".$dadosboleto["codigodebarras"]."</span></td>";

Browser other questions tagged

You are not signed in. Login or sign up in order to post.