title: How to convert color name to the corresponding hexadecimal representation in php?
body: <p>I have a variable ($color) which cointains values of color names, 'orange', 'red', etc.
  I don't know how to convert these values to hexadecimal, because I need the hexadecimal values for another function.</p>
  
  <p>For example:</p>
  
  <p>Convert:</p>
  
  <pre><code>black
  </code></pre>
  
  <p>To:</p>
  
  <pre><code>#000000
  </code></pre>
  
  <hr>
  
  <p>I also need to check if the color is a color name or a value in hexadecimal...</p>