I have a dynamic tag element that I need to replace particular tags in with PHP.
Basically I only need the tag <a>
part an replace <img>
with text. So for example:
<a target="_blank"
title="Visit MarcAira14 on Facebook"
href="http://www.facebook.com/MarcAira14"
>
<img alt="Facebook icon" src="/sites/all/modules/contrib/socialmedia/icons/levelten/glossy/48x48/facebook.png">
</a>
would become:
<a target="_blank"
title="Visit MarcAira14 on Facebook"
href="http://www.facebook.com/MarcAira14"
>Facebook</a>
I also need to grab the last string in the title attribute (title="Visit MarcAira14 on Facebook"
), in this case "Facebook"
.
Anyone with an idea or suggestion would be appreciated.