I have a string like this
.header{ font-family:; background-color:red; color:blue; line-height:; } .footer{ background-color:green; color:; }
I want to convert this string-like this
.header{ background-color:red; color:blue; } .footer{ background-color:green; }
How can I achieve this?
Advertisement
Answer
Try:
preg_replace('/.*:s*;/i', '', $string);
although, the output would include color:blue;
too and not just background-color:red;
for .header
?