I am looking to convert some HTML tags into strings. I want to be able to provide an array of tags which are to be converted into strings.
The 3 tags I am looking at are: img, iframe and script which should all display as a string when found inside a string.
Example:
Array: $tags = array("img");
String: This is a picture of my dog <img src="......">
I have looked at htmlentities
, htmlspecialchars
, etc. but they all seem to be all or nothing solutions.
Can any one help?
Thanks