Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/232.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用php解析字符串中的RGB值_Php_Parsing_Rgb - Fatal编程技术网

使用php解析字符串中的RGB值

使用php解析字符串中的RGB值,php,parsing,rgb,Php,Parsing,Rgb,有没有办法从一个字符串中解析多个RGB值?颜色应以何种方式编码 例如 $string=“foobar[rgb:123abc]一些其他文本和其他颜色:[rgb:ffeecc]” 我希望[rgb:xxxxxx]替换为类似的内容。您可以使用此正则表达式提取模式 /\[rgb:([0-9a-f]{6})\]/i

有没有办法从一个字符串中解析多个RGB值?颜色应以何种方式编码

例如

$string=“foobar[rgb:123abc]一些其他文本和其他颜色:[rgb:ffeecc]”


我希望
[rgb:xxxxxx]
替换为类似

的内容。您可以使用此正则表达式提取模式

/\[rgb:([0-9a-f]{6})\]/i