-2
Good morning everyone, I’m starting to venture into php and html. My question is, if possible html read several Hex color code in one line, mixing them!
For example
Let’s assume I have a php variable in:
$cor = '#00FF00HTML#0000FFPHP';
and the goal is for html to interpret this variable with the corresponding color
<p><?php echo $cor; ?></p>
Upshot
HTMLPHP
(in case HTML turns green, and PHP turns blue)Note: the example cited, it was only to be clearer the final objective!
You can deal with regular expressions looking for the hexas colors in your variable and build the final HTML applying the colors, but with this you run the risk of several delicate cases that would need to be considered, depends on your need.
– Woss