Image

Imagepkbarbiedoll wrote in Imagephp

Remove attribute from a tag

I need to remove the text-indent attribute from a string.  The attribute may have different values, so I can't hardcode str_replace('blah','',$string);.   


Examples:
<span style="font-weight: bold; text-indent: 0.8in;">

<span style="text-indent: 1.5in; font-size: 11px;">

<span style="text-indent: 30px;">

<span style=" text-indent: 3.0in;">



So I want to set something up that looks for a substring starting with text-indent and ending with the next ;, then deletes that substring. 

I'm sure I want to use Regular Expressions, but I'm not sure what I need to use. 

Suggestions are greatly appreciated.