PHP does not directly have any effect on colors in your browser. It is the HTML that is output by your script that will affect it. Therefore there is nothing special or unique with regard to PHP that you need to know about color codes.
In any case, you should be using CSS to control the display of your pages, rather than deprecated HTML attributes such as "bgcolor". At the most basic, you can use the "style" attribute in your HTML tags:
echo "<td style=background-color:#FF0099'>some text</td>";
Better would be to use as CSS stylesheet, and define a class within it that you can then apply to your HTML elements.
echo "<td class='some_class_name'>some text</td>";
Stylesheet:
.some_class_name {
background-color: #FF3399;
}