PHP Function for Colour Text to HEX Code

In a PHP project database, there was a text filed for colours that should be shown as a background colour of a box in front of the product name. Stored colours were like these: Blue BLUE Tomato Beech Flame Red Salmon … That some of them were not a standard colour for HTML, I searched the Internet for the colour to the HEX code table, and I added some non-standard but recurrent colours on that project like: Wood Charcol Gun Metal United Nations Blue … to this PHP function, you can add yours <?php function colourtexthex($colour_text) { // colour text to HEX code $colours = array ( ‘aliceblue’ => ‘F0F8FF’, ‘aluminium’ => ‘848789’, ‘antiquewhite’ => ‘FAEBD7’, ‘aqua’ => ’00FFFF’, ‘aquamarine’