$color = "#FF0000"; $text = "Text";
У меня есть этот код, но с синтаксической ошибкой.
echo '<div class = "text"><span style=\color": $color\">$text</span",'</div>';
Что не так? Я хотел бы повторить $ text с цветом $ color с классом div "text".
Попробуй это:
echo '<div class = "text"><span style = "color:', $color, '">',$text,'</span></div>';