I have a html string
$html = <p>I'm a para</p><b> I'm bold </b>
Now I can replace the bold tags with wiki markup(*) using php regex as:
$html = preg_replace('/<b>(.*?)<\/b>/', '*\1*', $html);
Apart from this I also want the leading and trailing whitespaces in the bold tag removed in the same php's preg_replace function.
Can anyone help me on how to do this?
Thanks in advance,
Varun