PHP Regular Expression to quotations to attributes

Posted by atwellpub on Stack Overflow See other posts from Stack Overflow or by atwellpub
Published on 2010-05-15T18:19:47Z Indexed on 2010/05/15 18:24 UTC
Read the original article Hit count: 173

Filed under:
|
|

hey Guys,

I need to run a string of html through a regex function that checks to see if the attributes are closed in quotes, and if they aren't then close them.

for example i want

<img src=http://www.domain.com/image.gif border=0>

to turn into

<img src='http://www.domain.com/image.gif' border='0'>

Can anyone help me?

© Stack Overflow or respective owner

Related posts about regex

Related posts about php