Can this be solved by using just regex?
- by Lost_in_code
I need to convert
$text = 'We had <i>fun</i>. Look at <a href="http://example.com">this photo</a> of Joe'
to
$text = 'We had fun. Take a look at this photo (http://example.com) of Joe'
All HTML tags are to be removed and the href value from <a> tags needs to be added like above.
What would be an efficient way to solve this? Any code snippet would be great.