Can anyone help me to solve this regular expression problem. Getting very frustrated as I've been fiddling with it for ages now.
Aim
To convert HTML into XHTML code, e.g. make <br> <br />
Code
$text = preg_replace('/(<img .*)("|\'| )>/i','\1\2 />',$text);
The problem
It replaces some other tags too. For example I have:
<a href.....> but it changes it to <a href...... />
Any suggestions?