Posted By

newsok on 10/26/10


Tagged

hex


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Desoxena


Matching hexadecimal color values


 / Published in: PHP
 

  1. $string = "#555555";
  2. if (preg_match('/^#(?:(?:[a-fd]{3}){1,2})$/i', $string)) {
  3. echo "example 6 successful.";
  4. }

Report this snippet  

You need to login to post a comment.