Possible Duplicate:
preg_replace how surround html attributes for a string with " in PHP
How to use preg_replace() for change all word that is within < > and after = for word with double quote surround
$var="<myfootball figure=thin new=aux(comment); > this=Association football < name=football >"
to
$var="<myfootball figure="thin" new="aux(comment);" >this=Association footballl< name="football" >"
What is the regular expresion for do this with preg_replace()?
Replace
(?<==)(\b\w+\b)(?!")(?=[^<]*>)with"$1"EDIT (based on OP’s comment and question update) >>
Replace
(?<==)(\b\S+?)(?=[\s>])(?!")(?=[^<]*>)with"$1"