I'm coding a PHP script supposed to create some boxes inside a webpage. I'm having problems setting the background color of the box. Here is the part of code involved:
<div class="container">
//$color is declared at the top of my file
<?php
echo '<div style="background-color: '<?='$color'?>'; width: 30px; height: 30px">'
?>
</div>
So background-color
should take the color from the $color variable, but i don't know how to make that PHP part inside the html statement. The error i get is syntax error, unexpected '?'