If you have this string in PHP:
$str = 'content<div style="color:rgb(0,0,0);">more content</div><div style="color: rgb(255,255,255);">more content</div>';
Is it possible to find the rgb occurrences and change them to hexadecimal so the new string is:
$new_str = 'content<div style="color:#000000;">more content</div><div style="color: #ffffff;">more content</div>';