I tried this, but doesn't work:
$color
is taken from a database as Char #cccccc; (this part works)
'<span style="color:<?php $color ?>"><?php echo "###"?></span>'
I'm a beginner. I can store the hex #cccccc on a database and echo it out.
echo
it. So echo $color
echo '<span style="color:<?php $color ?>"><?php echo "###"?></span>';
please include it in the question, so answers are not wrong I have found 2 mistakes.
echo
to print the value of color.here is the working code.
<span style="color:<?php echo $color; ?>">
Welcome to PHP <?php echo $color ?>
</span>