How to concatenate html tag in php?

Asked

Viewed 606 times

0

$t ='<span style=\"color:#FF0000;\"> ';
$t. "texto '</span>' ";
echo $t;

The code above does not work, nothing is printed. I believe the problem is the closure of tag span.

How to solve?

1 answer

1

There are some mistakes, but the basics would be:

$t ='<span style="color:#FF0000;"> ';
$t .= "texto </span> ";
echo $t;

Example - IDEONE

  • 1

    Thanks Virgilio. it worked out now.

Browser other questions tagged

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