hi,
Can anyone help me to write this eregi_replace() function.Basically this is to convert all the html tags to xhtml compatible.
I have a string as ,
$str="<img src='aa.jpg' height='12px'> some text <br> some text <hr> some text
<input type='button' name='b1' value='click me'>";
this $str can have any html tags that doesnt have a closing tag.
now what i want is to write individual eregi_replace() functions to convert all the non closing tags with a closing tag. I can hardcde the passing value because there are limited tags which are not having a closing tag.
I`m really not good in regular expresions. So please can anyone help me with writing the eregi_replace().
There is a special case like the tag <br>, Because this tag doesnt have any attributes but on the other hand <img> tag can have attribute. So our regular expression should be able to handdle the both cases.
I really appreciate your help.
Thanx in advance,
Regards,
Niroshan