在 PHP 中将十六进制颜色转换为 RGB 值
使用 PHP 将 #ffffff 等十六进制颜色值转换为单个 RGB 值 255 255 255 的好方法是什么?
What would be a good way to convert hex color values like #ffffff into the single RGB values 255 255 255 using PHP?
推荐答案
查看 PHP 的 hexdec() 和 dechex() 函数:http://php.net/manual/en/function.hexdec.php
Check out PHP's hexdec() and dechex() functions:
http://php.net/manual/en/function.hexdec.php
示例:
$value = hexdec('ff'); // $value = 255
相关文章