标签:search ati ret func fun false stat 正则 else
/**
* 判断是否十六进制颜色
* @param $str
* @return int
*/
public static function checkColor($str)
{
$search = ‘/^#([a-fA-F\d]{6}|[a-fA-F\d]{3})$/‘;
if (preg_match($search, $str)) {
return true;
} else {
return false;
}
}
标签:search ati ret func fun false stat 正则 else
原文地址:https://www.cnblogs.com/jiqing9006/p/13140194.html